void CGrenade::Load(HMESSAGEREAD hRead, uint32 dwLoadFlags) { if (!hRead) return; CProjectile::Load(hRead, dwLoadFlags); m_bSpinGrenade = (LTBOOL) g_pLTServer->ReadFromMessageByte(hRead); m_bUpdating = (LTBOOL) g_pLTServer->ReadFromMessageByte(hRead); m_eContainerCode = (ContainerCode) g_pLTServer->ReadFromMessageByte(hRead); m_eLastHitSurface = (SurfaceType) g_pLTServer->ReadFromMessageByte(hRead); m_fPitch = g_pLTServer->ReadFromMessageFloat(hRead); m_fYaw = g_pLTServer->ReadFromMessageFloat(hRead); m_fRoll = g_pLTServer->ReadFromMessageFloat(hRead); m_fPitchVel = g_pLTServer->ReadFromMessageFloat(hRead); m_fYawVel = g_pLTServer->ReadFromMessageFloat(hRead); m_fRollVel = g_pLTServer->ReadFromMessageFloat(hRead); LOAD_BOOL(m_bRotatedToRest); LOAD_INT(m_cBounces); if ( m_bRotatedToRest ) { g_lstGrenades.Add(this); } }
void CGrenade::RotateToRest() { // Record this grenade for AI's to be wary of if ( !m_bRotatedToRest ) { g_lstGrenades.Add(this); } // At rest m_bRotatedToRest = LTTRUE; m_bUpdating = LTFALSE; // Spin it if necessary if (m_bSpinGrenade) { LTRotation rRot; g_pLTServer->SetupEuler(&rRot, 0.0f, m_fYaw, 0.0f); g_pLTServer->SetObjectRotation(m_hObject, &rRot); } }