From 5dab7426451842793b183fbd961ad2ae83c8acbd Mon Sep 17 00:00:00 2001 From: red-001 Date: Sat, 20 Jan 2018 22:31:53 +0000 Subject: [CSM] Add functions to create particles and particlespawners. (#6072) --- src/particles.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/particles.h') diff --git a/src/particles.h b/src/particles.h index 72e48911a..9ea56385c 100644 --- a/src/particles.h +++ b/src/particles.h @@ -192,6 +192,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