1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-01-25 01:36:38 +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);
if (e)
{
int type = lua_tointeger(L, 2);
// cursor radius
float activationRadius = lua_tonumber(L, 3);
float range = lua_tonumber(L, 4);
e->activationType = (Entity::ActivationType)type;
e->activationRange = range;
e->activationRadius = activationRadius;
e->activationType = (Entity::ActivationType)lua_tointeger(L, 2); // cursor radius
e->activationRadius = lua_tonumber(L, 3);
e->activationRange = lua_tonumber(L, 4);
}
luaReturnNil();
}
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();
@ -10190,6 +10200,7 @@ static const struct {
luaRegister(entity_setBounce),
luaRegister(entity_setActivation),
luaRegister(entity_getActivation),
luaRegister(entity_rotateToEntity),
luaRegister(entity_fireGas),