mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-21 20:11:12 +00:00
Merge branch 'minor-lua-fixes' into 'next'
Minor Lua Fixes (CONS_Printf and mobj_t.valid) See merge request STJr/SRB2!1065
This commit is contained in:
commit
30d27ded6e
2 changed files with 6 additions and 5 deletions
|
@ -444,7 +444,7 @@ static int lib_consPrintf(lua_State *L)
|
|||
if (n < 2)
|
||||
return luaL_error(L, "CONS_Printf requires at least two arguments: player and text.");
|
||||
//HUDSAFE
|
||||
INLEVEL
|
||||
|
||||
plr = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||
if (!plr)
|
||||
return LUA_ErrInvalid(L, "player_t");
|
||||
|
|
|
@ -165,14 +165,15 @@ static int mobj_get(lua_State *L)
|
|||
enum mobj_e field = Lua_optoption(L, 2, NULL, mobj_opt);
|
||||
lua_settop(L, 2);
|
||||
|
||||
INLEVEL
|
||||
|
||||
if (!mo) {
|
||||
if (!mo || !ISINLEVEL) {
|
||||
if (field == mobj_valid) {
|
||||
lua_pushboolean(L, 0);
|
||||
return 1;
|
||||
}
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
if (!mo) {
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
} else
|
||||
return luaL_error(L, "Do not access an mobj_t field outside a level!");
|
||||
}
|
||||
|
||||
switch(field)
|
||||
|
|
Loading…
Reference in a new issue