fix action_call index numbers for the args, add missing breaks after LUA_TUSERDATA code in infolib (I am dumb dumb dumb dumb dumb dumb)

This commit is contained in:
Monster Iestyn 2017-11-01 16:52:12 +00:00
parent 42b955f4ca
commit a244948f21
2 changed files with 5 additions and 3 deletions

View File

@ -7904,9 +7904,9 @@ static int action_call(lua_State *L)
{
//actionf_t *action = lua_touserdata(L,lua_upvalueindex(1));
actionf_t *action = *((actionf_t **)luaL_checkudata(L, 1, META_ACTION));
mobj_t *actor = *((mobj_t **)luaL_checkudata(L,1,META_MOBJ));
var1 = (INT32)luaL_optinteger(L,2,0);
var2 = (INT32)luaL_optinteger(L,3,0);
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 2, META_MOBJ));
var1 = (INT32)luaL_optinteger(L, 3, 0);
var2 = (INT32)luaL_optinteger(L, 4, 0);
if (!actor)
return LUA_ErrInvalid(L, "mobj_t");
action->acp1(actor);

View File

@ -326,6 +326,7 @@ static int lib_setState(lua_State *L)
state->action = *action;
state->action.acv = action->acv;
state->action.acp1 = action->acp1;
break;
}
case LUA_TFUNCTION: // It's a function (a Lua function or a C function? either way!)
lua_getfield(L, LUA_REGISTRYINDEX, LREG_STATEACTION);
@ -531,6 +532,7 @@ static int state_set(lua_State *L)
st->action = *action;
st->action.acv = action->acv;
st->action.acp1 = action->acp1;
break;
}
case LUA_TFUNCTION: // It's a function (a Lua function or a C function? either way!)
lua_getfield(L, LUA_REGISTRYINDEX, LREG_STATEACTION);