Skip to content
Snippets Groups Projects
Commit 7f917503 authored by kaysrishaq's avatar kaysrishaq
Browse files

minor lua fixes

minor lua fixes
parent 34bd0d9f
Branches
No related tags found
No related merge requests found
...@@ -444,7 +444,7 @@ static int lib_consPrintf(lua_State *L) ...@@ -444,7 +444,7 @@ static int lib_consPrintf(lua_State *L)
if (n < 2) if (n < 2)
return luaL_error(L, "CONS_Printf requires at least two arguments: player and text."); return luaL_error(L, "CONS_Printf requires at least two arguments: player and text.");
//HUDSAFE //HUDSAFE
INLEVEL
plr = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); plr = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
if (!plr) if (!plr)
return LUA_ErrInvalid(L, "player_t"); return LUA_ErrInvalid(L, "player_t");
......
...@@ -165,14 +165,15 @@ static int mobj_get(lua_State *L) ...@@ -165,14 +165,15 @@ static int mobj_get(lua_State *L)
enum mobj_e field = Lua_optoption(L, 2, NULL, mobj_opt); enum mobj_e field = Lua_optoption(L, 2, NULL, mobj_opt);
lua_settop(L, 2); lua_settop(L, 2);
INLEVEL if (!mo || !ISINLEVEL) {
if (!mo) {
if (field == mobj_valid) { if (field == mobj_valid) {
lua_pushboolean(L, 0); lua_pushboolean(L, 0);
return 1; return 1;
} }
if (!mo) {
return LUA_ErrInvalid(L, "mobj_t"); return LUA_ErrInvalid(L, "mobj_t");
} else
return luaL_error(L, "Do not access an mobj_t field outside a level!");
} }
switch(field) switch(field)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment