aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2019-03-01 20:16:11 +0100
committerGitHub <noreply@github.com>2019-03-01 20:16:11 +0100
commit170dd409cbf1856600ee5089a95c096dd668b75e (patch)
treedd18026fbfe1e9c76f9081864174266109809996 /src/script/lua_api
parent111f1dc9c5f336f5b4f12c15940dc4cc2cbe7f82 (diff)
downloadminetest-170dd409cbf1856600ee5089a95c096dd668b75e.tar.gz
minetest-170dd409cbf1856600ee5089a95c096dd668b75e.tar.bz2
minetest-170dd409cbf1856600ee5089a95c096dd668b75e.zip
Fix particle spawners not visible since CSM spawner implementation (#8289)
* Drop the ID mapper, use a big u64 instead. This will permit to resync server ids properly with the manager code * Modernize some code parts (std::unordered_map, auto) * generate id on client part on U32_MAX + 1 ids, lower are for server ids
Diffstat (limited to 'src/script/lua_api')
-rw-r--r--src/script/lua_api/l_particles_local.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/script/lua_api/l_particles_local.cpp b/src/script/lua_api/l_particles_local.cpp
index 3c7a821ca..a9bf55665 100644
--- a/src/script/lua_api/l_particles_local.cpp
+++ b/src/script/lua_api/l_particles_local.cpp
@@ -154,9 +154,9 @@ int ModApiParticlesLocal::l_add_particlespawner(lua_State *L)
texture = getstringfield_default(L, 1, "texture", "");
glow = getintfield_default(L, 1, "glow", 0);
- u32 id = getClient(L)->getParticleManager()->getSpawnerId();
+ u64 id = getClient(L)->getParticleManager()->generateSpawnerId();
- ClientEvent *event = new ClientEvent();
+ auto event = new ClientEvent();
event->type = CE_ADD_PARTICLESPAWNER;
event->add_particlespawner.amount = amount;
event->add_particlespawner.spawntime = time;