mirror of
https://github.com/minetest/minetest.git
synced 2025-06-30 23:20:22 +02:00
Server: avoid re-use of recent ParticleSpawner and Sound IDs (#14045)
This improves the reliability when removing and re-adding handles quickly. Looping through the entire ID range avoids collisions caused by any race condition.
This commit is contained in:
@ -695,7 +695,7 @@ private:
|
||||
Sounds
|
||||
*/
|
||||
std::unordered_map<s32, ServerPlayingSound> m_playing_sounds;
|
||||
s32 m_next_sound_id = 0; // positive values only
|
||||
s32 m_playing_sounds_id_last_used = 0; // positive values only
|
||||
s32 nextSoundId();
|
||||
|
||||
ModStorageDatabase *m_mod_storage_database = nullptr;
|
||||
|
Reference in New Issue
Block a user