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:
parent
42b955f4ca
commit
a244948f21
|
@ -7904,9 +7904,9 @@ static int action_call(lua_State *L)
|
||||||
{
|
{
|
||||||
//actionf_t *action = lua_touserdata(L,lua_upvalueindex(1));
|
//actionf_t *action = lua_touserdata(L,lua_upvalueindex(1));
|
||||||
actionf_t *action = *((actionf_t **)luaL_checkudata(L, 1, META_ACTION));
|
actionf_t *action = *((actionf_t **)luaL_checkudata(L, 1, META_ACTION));
|
||||||
mobj_t *actor = *((mobj_t **)luaL_checkudata(L,1,META_MOBJ));
|
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 2, META_MOBJ));
|
||||||
var1 = (INT32)luaL_optinteger(L,2,0);
|
var1 = (INT32)luaL_optinteger(L, 3, 0);
|
||||||
var2 = (INT32)luaL_optinteger(L,3,0);
|
var2 = (INT32)luaL_optinteger(L, 4, 0);
|
||||||
if (!actor)
|
if (!actor)
|
||||||
return LUA_ErrInvalid(L, "mobj_t");
|
return LUA_ErrInvalid(L, "mobj_t");
|
||||||
action->acp1(actor);
|
action->acp1(actor);
|
||||||
|
|
|
@ -326,6 +326,7 @@ static int lib_setState(lua_State *L)
|
||||||
state->action = *action;
|
state->action = *action;
|
||||||
state->action.acv = action->acv;
|
state->action.acv = action->acv;
|
||||||
state->action.acp1 = action->acp1;
|
state->action.acp1 = action->acp1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case LUA_TFUNCTION: // It's a function (a Lua function or a C function? either way!)
|
case LUA_TFUNCTION: // It's a function (a Lua function or a C function? either way!)
|
||||||
lua_getfield(L, LUA_REGISTRYINDEX, LREG_STATEACTION);
|
lua_getfield(L, LUA_REGISTRYINDEX, LREG_STATEACTION);
|
||||||
|
@ -531,6 +532,7 @@ static int state_set(lua_State *L)
|
||||||
st->action = *action;
|
st->action = *action;
|
||||||
st->action.acv = action->acv;
|
st->action.acv = action->acv;
|
||||||
st->action.acp1 = action->acp1;
|
st->action.acp1 = action->acp1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case LUA_TFUNCTION: // It's a function (a Lua function or a C function? either way!)
|
case LUA_TFUNCTION: // It's a function (a Lua function or a C function? either way!)
|
||||||
lua_getfield(L, LUA_REGISTRYINDEX, LREG_STATEACTION);
|
lua_getfield(L, LUA_REGISTRYINDEX, LREG_STATEACTION);
|
||||||
|
|
Loading…
Reference in a new issue