1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-01-26 02:07:26 +00:00

Cleanup entity activation, add Lua getter

+ entity_getActivation()
This commit is contained in:
fgenesis 2022-11-24 02:03:24 +01:00
parent 9583375537
commit 7f3e457559

View file

@ -7400,13 +7400,23 @@ luaFunc(entity_setActivation)
ScriptedEntity *e = scriptedEntity(L); ScriptedEntity *e = scriptedEntity(L);
if (e) if (e)
{ {
int type = lua_tointeger(L, 2); e->activationType = (Entity::ActivationType)lua_tointeger(L, 2); // cursor radius
// cursor radius e->activationRadius = lua_tonumber(L, 3);
float activationRadius = lua_tonumber(L, 3); e->activationRange = lua_tonumber(L, 4);
float range = lua_tonumber(L, 4); }
e->activationType = (Entity::ActivationType)type;
e->activationRange = range; luaReturnNil();
e->activationRadius = activationRadius; }
luaFunc(entity_getActivation)
{
ScriptedEntity *e = scriptedEntity(L);
if (e)
{
lua_pushinteger(L, e->activationType);
lua_pushnumber(L, e->activationRadius);
lua_pushnumber(L, e->activationRange);
return 3;
} }
luaReturnNil(); luaReturnNil();
@ -10190,6 +10200,7 @@ static const struct {
luaRegister(entity_setBounce), luaRegister(entity_setBounce),
luaRegister(entity_setActivation), luaRegister(entity_setActivation),
luaRegister(entity_getActivation),
luaRegister(entity_rotateToEntity), luaRegister(entity_rotateToEntity),
luaRegister(entity_fireGas), luaRegister(entity_fireGas),