Ça devrait crier moins

This commit is contained in:
MarcEricMartel 2023-12-16 12:57:04 -05:00
parent dec9da6395
commit 547d0fb3f8
2 changed files with 3 additions and 1 deletions

View File

@ -1564,8 +1564,9 @@ void Engine::Render(float elapsedTime) {
}
RemotePlayer* rt = static_cast<RemotePlayer*>(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;

View File

@ -249,6 +249,7 @@ private:
std::deque<netprot::ChunkMod*> m_chunkmod_manifest;
std::chrono::high_resolution_clock::time_point m_startTime;
std::unordered_map<uint64_t, Player*> m_players;
std::set<uint64_t> m_deadplayers;
netprot::Buffer m_buf, m_bufout;
netprot::ChunkMod* m_chunkmod = nullptr;