1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 16:45:20 +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:
SmallJoker
2023-11-29 21:10:19 +01:00
committed by GitHub
parent d6a8b546e4
commit a7e5456099
4 changed files with 25 additions and 16 deletions

View File

@@ -512,6 +512,7 @@ private:
// Particles
IntervalLimiter m_particle_management_interval;
std::unordered_map<u32, float> m_particle_spawners;
u32 m_particle_spawners_id_last_used = 0;
std::unordered_map<u32, u16> m_particle_spawner_attachments;
// Environment metrics