mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-17 01:21:18 +00:00
added "sector" as a Lua-exclusive shortcut to polyobj->lines[0]->backsector in polyobj_t
This commit is contained in:
parent
e6136eb113
commit
89e989d6b1
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…
Reference in a new issue