void Player::Kill() { if( m_state == DEAD ) return; Corpse* c = Game::SpawnBody(); c->SetTranslation( transform.GetTranslation() ); c->Rotate( float3( 0, -m_rotation * ( 180 / PI ), 0 ) ); m_timeOfDeath.reset(); m_state = DEAD; m_enabled = false; if( s_hudgun && m_isLocalPlayer ) s_hudgun->m_enabled = false; if( m_flag ) { Log::Get()->Print( "The %s flag has been returned!", ( m_team == Team::RED ) ? "red" : "blue" ); m_flag->Reset(); m_flag = nullptr; } char* sound[5] = { "assets/sound/death1.wav", "assets/sound/death2.wav", "assets/sound/death3.wav", "assets/sound/death4.wav", "assets/sound/death5.wav", }; int randomSound = (int)Rand( 5 ); Audio::Get()->PlaySound( sound[randomSound] ); if( Network::Get()->IsServer() ) { Network::Get()->server->SendAction( PlayerAction::DEATH, m_id ); } }