mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-28 05:11:34 +00:00
Add mobj.standingslope to Lua
This commit is contained in:
parent
2ec4f2024f
commit
efff869e6e
1 changed files with 17 additions and 0 deletions
|
@ -80,7 +80,12 @@ enum mobj_e {
|
|||
mobj_extravalue1,
|
||||
mobj_extravalue2,
|
||||
mobj_cusval,
|
||||
#ifdef ESLOPE
|
||||
mobj_cvmem,
|
||||
mobj_standingslope
|
||||
#else
|
||||
mobj_cvmem
|
||||
#endif
|
||||
};
|
||||
|
||||
static const char *const mobj_opt[] = {
|
||||
|
@ -140,6 +145,9 @@ static const char *const mobj_opt[] = {
|
|||
"extravalue2",
|
||||
"cusval",
|
||||
"cvmem",
|
||||
#ifdef ESLOPE
|
||||
"standingslope",
|
||||
#endif
|
||||
NULL};
|
||||
|
||||
#define UNIMPLEMENTED luaL_error(L, LUA_QL("mobj_t") " field " LUA_QS " is not implemented for Lua and cannot be accessed.", mobj_opt[field])
|
||||
|
@ -343,6 +351,11 @@ static int mobj_get(lua_State *L)
|
|||
case mobj_cvmem:
|
||||
lua_pushinteger(L, mo->cvmem);
|
||||
break;
|
||||
#ifdef ESLOPE
|
||||
case mobj_standingslope:
|
||||
LUA_PushUserdata(L, mo->standingslope, META_SLOPE);
|
||||
break;
|
||||
#endif
|
||||
default: // extra custom variables in Lua memory
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, LREG_EXTVARS);
|
||||
I_Assert(lua_istable(L, -1));
|
||||
|
@ -634,6 +647,10 @@ static int mobj_set(lua_State *L)
|
|||
case mobj_cvmem:
|
||||
mo->cvmem = luaL_checkinteger(L, 3);
|
||||
break;
|
||||
#ifdef ESLOPE
|
||||
case mobj_standingslope:
|
||||
return NOSET;
|
||||
#endif
|
||||
default:
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, LREG_EXTVARS);
|
||||
I_Assert(lua_istable(L, -1));
|
||||
|
|
Loading…
Reference in a new issue