1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-12-26 06:35:51 +00:00

Add riding related Lua functions:

- entity_getRidingPosition()
- entity_getRidingRotation()
- entity_getRidingFlip()
This commit is contained in:
fgenesis 2013-09-29 01:27:36 +02:00
parent 36c409e1d4
commit 84f1b12c67

View file

@ -2435,6 +2435,28 @@ luaFunc(entity_setRidingData)
luaReturnNil();
}
luaFunc(entity_getRidingPosition)
{
Entity *e = entity(L);
Vector v;
if (e)
v = e->getRidingPosition();
luaReturnVec2(v.x, v.y);
}
luaFunc(entity_getRidingRotation)
{
Entity *e = entity(L);
luaReturnNum(e ? e->getRidingRotation() : 0.0f);
}
luaFunc(entity_getRidingFlip)
{
Entity *e = entity(L);
luaReturnBool(e && e->getRidingFlip());
}
luaFunc(entity_setBoneLock)
{
Entity *e = entity(L);
@ -8561,6 +8583,9 @@ static const struct {
luaRegister(entity_setRidingPosition),
luaRegister(entity_setRidingData),
luaRegister(entity_getRidingPosition),
luaRegister(entity_getRidingRotation),
luaRegister(entity_getRidingFlip),
luaRegister(entity_setBoneLock),
luaRegister(entity_setIngredient),
luaRegister(entity_setDeathScene),