diff --git a/SQCSim2021/engine.cpp b/SQCSim2021/engine.cpp index 141f100..01021b1 100644 --- a/SQCSim2021/engine.cpp +++ b/SQCSim2021/engine.cpp @@ -1564,8 +1564,9 @@ void Engine::Render(float elapsedTime) { } RemotePlayer* rt = static_cast(m_players[out.id]); rt->Feed(out); - if (rt->AmIDead()) { + if (rt->AmIDead() && !m_deadplayers.count(out.id)) { m_audio.Create3DAudioObj(m_scream, AUDIO_PATH "scream.wav", m_player.GetPOV(), m_player.GetVelocity(), false, m_sfxvolume); + m_deadplayers.insert(out.id); } } break; diff --git a/SQCSim2021/engine.h b/SQCSim2021/engine.h index 1a1303a..cd3ee36 100644 --- a/SQCSim2021/engine.h +++ b/SQCSim2021/engine.h @@ -249,6 +249,7 @@ private: std::deque m_chunkmod_manifest; std::chrono::high_resolution_clock::time_point m_startTime; std::unordered_map m_players; + std::set m_deadplayers; netprot::Buffer m_buf, m_bufout; netprot::ChunkMod* m_chunkmod = nullptr;