mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 23:42:11 +00:00
Fix Lua versions of P_ZMovement and its clones as well as P_MovePlayer so tmthing changes don't linger afterwards
This commit is contained in:
parent
07801a2a18
commit
ada6ec07db
1 changed files with 10 additions and 0 deletions
|
@ -1044,48 +1044,56 @@ static int lib_pSceneryXYMovement(lua_State *L)
|
||||||
static int lib_pZMovement(lua_State *L)
|
static int lib_pZMovement(lua_State *L)
|
||||||
{
|
{
|
||||||
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||||
|
mobj_t *ptmthing = tmthing;
|
||||||
NOHUD
|
NOHUD
|
||||||
INLEVEL
|
INLEVEL
|
||||||
if (!actor)
|
if (!actor)
|
||||||
return LUA_ErrInvalid(L, "mobj_t");
|
return LUA_ErrInvalid(L, "mobj_t");
|
||||||
lua_pushboolean(L, P_ZMovement(actor));
|
lua_pushboolean(L, P_ZMovement(actor));
|
||||||
P_CheckPosition(actor, actor->x, actor->y);
|
P_CheckPosition(actor, actor->x, actor->y);
|
||||||
|
P_SetTarget(&tmthing, ptmthing);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lib_pRingZMovement(lua_State *L)
|
static int lib_pRingZMovement(lua_State *L)
|
||||||
{
|
{
|
||||||
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||||
|
mobj_t *ptmthing = tmthing;
|
||||||
NOHUD
|
NOHUD
|
||||||
INLEVEL
|
INLEVEL
|
||||||
if (!actor)
|
if (!actor)
|
||||||
return LUA_ErrInvalid(L, "mobj_t");
|
return LUA_ErrInvalid(L, "mobj_t");
|
||||||
P_RingZMovement(actor);
|
P_RingZMovement(actor);
|
||||||
P_CheckPosition(actor, actor->x, actor->y);
|
P_CheckPosition(actor, actor->x, actor->y);
|
||||||
|
P_SetTarget(&tmthing, ptmthing);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lib_pSceneryZMovement(lua_State *L)
|
static int lib_pSceneryZMovement(lua_State *L)
|
||||||
{
|
{
|
||||||
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||||
|
mobj_t *ptmthing = tmthing;
|
||||||
NOHUD
|
NOHUD
|
||||||
INLEVEL
|
INLEVEL
|
||||||
if (!actor)
|
if (!actor)
|
||||||
return LUA_ErrInvalid(L, "mobj_t");
|
return LUA_ErrInvalid(L, "mobj_t");
|
||||||
lua_pushboolean(L, P_SceneryZMovement(actor));
|
lua_pushboolean(L, P_SceneryZMovement(actor));
|
||||||
P_CheckPosition(actor, actor->x, actor->y);
|
P_CheckPosition(actor, actor->x, actor->y);
|
||||||
|
P_SetTarget(&tmthing, ptmthing);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lib_pPlayerZMovement(lua_State *L)
|
static int lib_pPlayerZMovement(lua_State *L)
|
||||||
{
|
{
|
||||||
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||||
|
mobj_t *ptmthing = tmthing;
|
||||||
NOHUD
|
NOHUD
|
||||||
INLEVEL
|
INLEVEL
|
||||||
if (!actor)
|
if (!actor)
|
||||||
return LUA_ErrInvalid(L, "mobj_t");
|
return LUA_ErrInvalid(L, "mobj_t");
|
||||||
P_PlayerZMovement(actor);
|
P_PlayerZMovement(actor);
|
||||||
P_CheckPosition(actor, actor->x, actor->y);
|
P_CheckPosition(actor, actor->x, actor->y);
|
||||||
|
P_SetTarget(&tmthing, ptmthing);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1472,11 +1480,13 @@ static int lib_pSpawnSkidDust(lua_State *L)
|
||||||
static int lib_pMovePlayer(lua_State *L)
|
static int lib_pMovePlayer(lua_State *L)
|
||||||
{
|
{
|
||||||
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||||
|
mobj_t *ptmthing = tmthing;
|
||||||
NOHUD
|
NOHUD
|
||||||
INLEVEL
|
INLEVEL
|
||||||
if (!player)
|
if (!player)
|
||||||
return LUA_ErrInvalid(L, "player_t");
|
return LUA_ErrInvalid(L, "player_t");
|
||||||
P_MovePlayer(player);
|
P_MovePlayer(player);
|
||||||
|
P_SetTarget(&tmthing, ptmthing);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue