mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-31 05:30:48 +00:00
minor lua fixes
minor lua fixes
This commit is contained in:
parent
34bd0d9fe7
commit
7f9175033d
2 changed files with 6 additions and 5 deletions
|
@ -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)
|
||||||
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)
|
||||||
|
|
Loading…
Reference in a new issue