mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-18 02:21:47 +00:00
add quick error messages to make toaster happy
This commit is contained in:
parent
a244948f21
commit
fbe5654477
2 changed files with 4 additions and 4 deletions
|
@ -8336,10 +8336,10 @@ static int lib_getActionName(lua_State *L)
|
||||||
actionf_t *action = *((actionf_t **)luaL_checkudata(L, 1, META_ACTION));
|
actionf_t *action = *((actionf_t **)luaL_checkudata(L, 1, META_ACTION));
|
||||||
const char *name = NULL;
|
const char *name = NULL;
|
||||||
if (!action)
|
if (!action)
|
||||||
return 0; // insert error here (or not?)
|
return luaL_error(L, "not a valid action?");
|
||||||
name = LUA_GetActionName(action);
|
name = LUA_GetActionName(action);
|
||||||
if (!name) // that can't be right?
|
if (!name) // that can't be right?
|
||||||
return 0;
|
return luaL_error(L, "no name string could be found for this action");
|
||||||
lua_pushstring(L, name);
|
lua_pushstring(L, name);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -321,7 +321,7 @@ static int lib_setState(lua_State *L)
|
||||||
actionf_t *action = *((actionf_t **)luaL_checkudata(L, 3, META_ACTION));
|
actionf_t *action = *((actionf_t **)luaL_checkudata(L, 3, META_ACTION));
|
||||||
|
|
||||||
if (!action)
|
if (!action)
|
||||||
return 0; //insert error here
|
return luaL_error(L, "not a valid action?");
|
||||||
|
|
||||||
state->action = *action;
|
state->action = *action;
|
||||||
state->action.acv = action->acv;
|
state->action.acv = action->acv;
|
||||||
|
@ -527,7 +527,7 @@ static int state_set(lua_State *L)
|
||||||
actionf_t *action = *((actionf_t **)luaL_checkudata(L, 3, META_ACTION));
|
actionf_t *action = *((actionf_t **)luaL_checkudata(L, 3, META_ACTION));
|
||||||
|
|
||||||
if (!action)
|
if (!action)
|
||||||
return 0; //insert error here
|
return luaL_error(L, "not a valid action?");
|
||||||
|
|
||||||
st->action = *action;
|
st->action = *action;
|
||||||
st->action.acv = action->acv;
|
st->action.acv = action->acv;
|
||||||
|
|
Loading…
Reference in a new issue