mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 07:22:28 +00:00
Move INLEVEL macros for mobj_get and mobj_set to prevent mixed code/declaration errors.
This commit is contained in:
parent
37101f826e
commit
630bdaa876
1 changed files with 4 additions and 2 deletions
|
@ -160,11 +160,12 @@ static const char *const mobj_opt[] = {
|
|||
|
||||
static int mobj_get(lua_State *L)
|
||||
{
|
||||
INLEVEL
|
||||
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
enum mobj_e field = Lua_optoption(L, 2, NULL, mobj_opt);
|
||||
lua_settop(L, 2);
|
||||
|
||||
INLEVEL
|
||||
|
||||
if (!mo) {
|
||||
if (field == mobj_valid) {
|
||||
lua_pushboolean(L, 0);
|
||||
|
@ -406,11 +407,12 @@ static int mobj_get(lua_State *L)
|
|||
#define NOSETPOS luaL_error(L, LUA_QL("mobj_t") " field " LUA_QS " should not be set directly. Use " LUA_QL("P_Move") ", " LUA_QL("P_TryMove") ", or " LUA_QL("P_TeleportMove") " instead.", mobj_opt[field])
|
||||
static int mobj_set(lua_State *L)
|
||||
{
|
||||
INLEVEL
|
||||
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
enum mobj_e field = Lua_optoption(L, 2, mobj_opt[0], mobj_opt);
|
||||
lua_settop(L, 3);
|
||||
|
||||
INLEVEL
|
||||
|
||||
if (!mo)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
|
||||
|
|
Loading…
Reference in a new issue