mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 06:21:50 +00:00
add particles.is_alive
This commit is contained in:
parent
edb4ce02ca
commit
f95b743a6c
1 changed files with 8 additions and 0 deletions
|
|
@ -72,10 +72,18 @@ static int l_set_origin(lua::State* L) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int l_is_alive(lua::State* L) {
|
||||||
|
u64id_t id = lua::touinteger(L, 1);
|
||||||
|
if (auto emitter = renderer->particles->getEmitter(id)) {
|
||||||
|
return lua::pushboolean(L, !emitter->isDead());
|
||||||
|
}
|
||||||
|
return lua::pushboolean(L, false);
|
||||||
|
}
|
||||||
|
|
||||||
const luaL_Reg particleslib[] = {
|
const luaL_Reg particleslib[] = {
|
||||||
{"emit", lua::wrap<l_emit>},
|
{"emit", lua::wrap<l_emit>},
|
||||||
{"stop", lua::wrap<l_stop>},
|
{"stop", lua::wrap<l_stop>},
|
||||||
|
{"is_alive", lua::wrap<l_is_alive>},
|
||||||
{"get_origin", lua::wrap<l_get_origin>},
|
{"get_origin", lua::wrap<l_get_origin>},
|
||||||
{"set_origin", lua::wrap<l_set_origin>},
|
{"set_origin", lua::wrap<l_set_origin>},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue