void EjectedPilotClass::HitGround() { if(drawPointer){ OTWDriver.RemoveObject(drawPointer, TRUE); drawPointer = NULL; } if (_stage != PD_SAFE_LANDING ){ // No strength left. strength = 0.0; pctStrength = 0.0; // Send the death message if(_deathMsg != NULL) { FalconSendMessage (_deathMsg,FALSE); _deathMsg = NULL; } // Dead. No countdown. Just dead. dyingTimer = 0.0f; } // Right now, handle the same way whether dead or alive, just destroy // the object. SetDead(TRUE); SetExploding(TRUE); }
//----------------------------------------------------------------------------- // Purpose: Update entity with updated data from the server //----------------------------------------------------------------------------- void CShip::OnReceiveServerUpdate( ServerShipUpdateData_t *pUpdateData ) { if ( m_bIsServerInstance ) { OutputDebugString( "Should not be receiving server updates on the server itself\n" ); return; } SetDisabled( pUpdateData->GetDisabled() ); SetExploding( pUpdateData->GetExploding() ); SetPosition( pUpdateData->GetXPosition()*m_pGameEngine->GetViewportWidth(), pUpdateData->GetYPosition()*m_pGameEngine->GetViewportHeight() ); SetVelocity( pUpdateData->GetXVelocity(), pUpdateData->GetYVelocity() ); SetAccumulatedRotation( pUpdateData->GetRotation() ); m_bForwardThrustersActive = pUpdateData->GetForwardThrustersActive(); m_bReverseThrustersActive = pUpdateData->GetReverseThrustersActive(); // Update the photon beams for ( int i=0; i < MAX_PHOTON_BEAMS_PER_SHIP; ++i ) { ServerPhotonBeamUpdateData_t *pPhotonUpdate = pUpdateData->AccessPhotonBeamData( i ); if ( pPhotonUpdate->GetActive() ) { if ( !m_rgPhotonBeams[i] ) { m_rgPhotonBeams[i] = new CPhotonBeam( m_pGameEngine, pPhotonUpdate->GetXPosition(), pPhotonUpdate->GetYPosition(), m_dwShipColor, pPhotonUpdate->GetRotation(), pPhotonUpdate->GetXVelocity(), pPhotonUpdate->GetYVelocity() ); } else { m_rgPhotonBeams[i]->OnReceiveServerUpdate( pPhotonUpdate ); } } else { if ( m_rgPhotonBeams[i] ) { delete m_rgPhotonBeams[i]; m_rgPhotonBeams[i] = NULL; } } } }