mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-29 11:12:30 +00:00
added "sector" as a Lua-exclusive shortcut to polyobj->lines[0]->backsector in polyobj_t
This commit is contained in:
parent
ecc5182078
commit
aa76af1bbb
1 changed files with 5 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ enum polyobj_e {
|
|||
polyobj_valid = 0,
|
||||
polyobj_id,
|
||||
polyobj_parent,
|
||||
polyobj_sector,
|
||||
polyobj_angle,
|
||||
polyobj_damage,
|
||||
polyobj_thrust,
|
||||
|
|
@ -32,6 +33,7 @@ static const char *const polyobj_opt[] = {
|
|||
"valid",
|
||||
"id",
|
||||
"parent",
|
||||
"sector",
|
||||
"angle",
|
||||
"damage",
|
||||
"thrust",
|
||||
|
|
@ -64,6 +66,9 @@ static int polyobj_get(lua_State *L)
|
|||
case polyobj_parent:
|
||||
lua_pushinteger(L, polyobj->parent);
|
||||
break;
|
||||
case polyobj_sector: // shortcut that exists only in Lua!
|
||||
LUA_PushUserdata(L, polyobj->lines[0]->backsector, META_SECTOR);
|
||||
break;
|
||||
case polyobj_angle:
|
||||
lua_pushangle(L, polyobj->angle);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue