aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
Diffstat (limited to 'src/script')
-rw-r--r--src/script/lua_api/l_particles.cpp14
-rw-r--r--src/script/lua_api/l_particles_local.cpp14
2 files changed, 28 insertions, 0 deletions
diff --git a/src/script/lua_api/l_particles.cpp b/src/script/lua_api/l_particles.cpp
index 7680aa17b..a51c4fe20 100644
--- a/src/script/lua_api/l_particles.cpp
+++ b/src/script/lua_api/l_particles.cpp
@@ -111,6 +111,13 @@ int ModApiParticles::l_add_particle(lua_State *L)
p.texture = getstringfield_default(L, 1, "texture", p.texture);
p.glow = getintfield_default(L, 1, "glow", p.glow);
+ lua_getfield(L, 1, "node");
+ if (lua_istable(L, -1))
+ p.node = readnode(L, -1, getGameDef(L)->ndef());
+ lua_pop(L, 1);
+
+ p.node_tile = getintfield_default(L, 1, "node_tile", p.node_tile);
+
playername = getstringfield_default(L, 1, "playername", "");
}
@@ -231,6 +238,13 @@ int ModApiParticles::l_add_particlespawner(lua_State *L)
p.texture = getstringfield_default(L, 1, "texture", p.texture);
playername = getstringfield_default(L, 1, "playername", "");
p.glow = getintfield_default(L, 1, "glow", p.glow);
+
+ lua_getfield(L, 1, "node");
+ if (lua_istable(L, -1))
+ p.node = readnode(L, -1, getGameDef(L)->ndef());
+ lua_pop(L, 1);
+
+ p.node_tile = getintfield_default(L, 1, "node_tile", p.node_tile);
}
u32 id = getServer(L)->addParticleSpawner(p, attached, playername);
diff --git a/src/script/lua_api/l_particles_local.cpp b/src/script/lua_api/l_particles_local.cpp
index 9595b2fab..cc68b13a5 100644
--- a/src/script/lua_api/l_particles_local.cpp
+++ b/src/script/lua_api/l_particles_local.cpp
@@ -67,6 +67,13 @@ int ModApiParticlesLocal::l_add_particle(lua_State *L)
p.texture = getstringfield_default(L, 1, "texture", p.texture);
p.glow = getintfield_default(L, 1, "glow", p.glow);
+ lua_getfield(L, 1, "node");
+ if (lua_istable(L, -1))
+ p.node = readnode(L, -1, getGameDef(L)->ndef());
+ lua_pop(L, 1);
+
+ p.node_tile = getintfield_default(L, 1, "node_tile", p.node_tile);
+
ClientEvent *event = new ClientEvent();
event->type = CE_SPAWN_PARTICLE;
event->spawn_particle = new ParticleParameters(p);
@@ -134,6 +141,13 @@ int ModApiParticlesLocal::l_add_particlespawner(lua_State *L)
p.texture = getstringfield_default(L, 1, "texture", p.texture);
p.glow = getintfield_default(L, 1, "glow", p.glow);
+ lua_getfield(L, 1, "node");
+ if (lua_istable(L, -1))
+ p.node = readnode(L, -1, getGameDef(L)->ndef());
+ lua_pop(L, 1);
+
+ p.node_tile = getintfield_default(L, 1, "node_tile", p.node_tile);
+
u64 id = getClient(L)->getParticleManager()->generateSpawnerId();
auto event = new ClientEvent();