mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Implement spawning particles with node texture appearance
This commit is contained in:
parent
15ba75e4cf
commit
9d6e7e48d6
10 changed files with 145 additions and 20 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue