diff --git a/src/dehacked.c b/src/dehacked.c index ec63f619a..8f6dbaa1a 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8336,10 +8336,10 @@ static int lib_getActionName(lua_State *L) actionf_t *action = *((actionf_t **)luaL_checkudata(L, 1, META_ACTION)); const char *name = NULL; if (!action) - return 0; // insert error here (or not?) + return luaL_error(L, "not a valid action?"); name = LUA_GetActionName(action); 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); return 1; } diff --git a/src/lua_infolib.c b/src/lua_infolib.c index be146a04c..8f2ce67cd 100644 --- a/src/lua_infolib.c +++ b/src/lua_infolib.c @@ -321,7 +321,7 @@ static int lib_setState(lua_State *L) actionf_t *action = *((actionf_t **)luaL_checkudata(L, 3, META_ACTION)); if (!action) - return 0; //insert error here + return luaL_error(L, "not a valid action?"); state->action = *action; 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)); if (!action) - return 0; //insert error here + return luaL_error(L, "not a valid action?"); st->action = *action; st->action.acv = action->acv;