From 111f1dc9c5f336f5b4f12c15940dc4cc2cbe7f82 Mon Sep 17 00:00:00 2001 From: Loïc Blot Date: Tue, 26 Feb 2019 08:53:53 +0100 Subject: Revert "Revert CSM particles commit to fix particle spawner bug for 5.0.0 (#8288)" This reverts commit 01cd63bd3bca0192dab2834faf414b022706a77e. --- src/client/client.h | 6 ++++-- src/client/particles.h | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src/client') diff --git a/src/client/client.h b/src/client/client.h index 57623f164..60735f665 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -565,8 +565,10 @@ private: // And relations to objects std::unordered_map m_sounds_to_objects; - // HUD - // Mapping from server hud ids to internal hud ids + // CSM/client IDs to SSM/server IDs Mapping + // Map server particle spawner IDs to client IDs + std::unordered_map m_particles_server_to_client; + // Map server hud ids to client hud ids std::unordered_map m_hud_server_to_client; // Privileges diff --git a/src/client/particles.h b/src/client/particles.h index d1854ecbf..3392e7e95 100644 --- a/src/client/particles.h +++ b/src/client/particles.h @@ -196,6 +196,14 @@ public: void addNodeParticle(IGameDef *gamedef, LocalPlayer *player, v3s16 pos, const MapNode &n, const ContentFeatures &f); + u32 getSpawnerId() const + { + for (u32 id = 0;; ++id) { // look for unused particlespawner id + if (m_particle_spawners.find(id) == m_particle_spawners.end()) + return id; + } + } + protected: void addParticle(Particle* toadd); -- cgit v1.2.3