summaryrefslogtreecommitdiff
path: root/src/client/particles.h
diff options
context:
space:
mode:
authorLoïc Blot <loic.blot@unix-experience.fr>2019-02-26 08:53:53 +0100
committerLoïc Blot <loic.blot@unix-experience.fr>2019-02-26 08:53:53 +0100
commit111f1dc9c5f336f5b4f12c15940dc4cc2cbe7f82 (patch)
tree3d5039d7fcddcd5aac3ba9fa6dd124b0f4bb7884 /src/client/particles.h
parent911db0e25613e57d436ca39ee055d2fb4ee771aa (diff)
downloadminetest-111f1dc9c5f336f5b4f12c15940dc4cc2cbe7f82.tar.gz
minetest-111f1dc9c5f336f5b4f12c15940dc4cc2cbe7f82.tar.bz2
minetest-111f1dc9c5f336f5b4f12c15940dc4cc2cbe7f82.zip
Revert "Revert CSM particles commit to fix particle spawner bug for 5.0.0 (#8288)"
This reverts commit 01cd63bd3bca0192dab2834faf414b022706a77e.
Diffstat (limited to 'src/client/particles.h')
-rw-r--r--src/client/particles.h8
1 files changed, 8 insertions, 0 deletions
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);