mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-24 03:32:22 +00:00
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
2 changed files with 5 additions and 3 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue