diff options
author | sfan5 <sfan5@live.de> | 2020-05-22 14:17:03 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2020-05-23 22:52:21 +0200 |
commit | 9d6e7e48d6fb1daff8fedcb2f111164bef61f1e7 (patch) | |
tree | b4526e1feb6a2423b967ba120afd5da37d813d41 /src/script/lua_api/l_particles.cpp | |
parent | 15ba75e4cf1d1b8ceaa9d8ce33dcfdd7dbe80741 (diff) | |
download | minetest-9d6e7e48d6fb1daff8fedcb2f111164bef61f1e7.tar.gz minetest-9d6e7e48d6fb1daff8fedcb2f111164bef61f1e7.tar.bz2 minetest-9d6e7e48d6fb1daff8fedcb2f111164bef61f1e7.zip |
Implement spawning particles with node texture appearance
Diffstat (limited to 'src/script/lua_api/l_particles.cpp')
-rw-r--r-- | src/script/lua_api/l_particles.cpp | 14 |
1 files changed, 14 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); |