mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Add P_SetAngle, P_SetPitch and P_SetRoll to the Lua API.
This commit is contained in:
parent
d3cbf0cd6f
commit
c85206f633
1 changed files with 40 additions and 0 deletions
|
|
@ -1484,6 +1484,43 @@ static int lib_pMoveOrigin(lua_State *L)
|
|||
return 2;
|
||||
}
|
||||
|
||||
static int lib_pSetAngle(lua_State *L)
|
||||
{
|
||||
mobj_t *thing = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
angle_t newValue = luaL_checkangle(L, 2);
|
||||
NOHUD
|
||||
INLEVEL
|
||||
|
||||
if (!thing)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
P_InitAngle(thing, newValue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_pSetPitch(lua_State *L)
|
||||
{
|
||||
mobj_t *thing = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
angle_t newValue = luaL_checkangle(L, 2);
|
||||
NOHUD
|
||||
INLEVEL
|
||||
if (!thing)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
P_InitPitch(thing, newValue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_pSetRoll(lua_State *L)
|
||||
{
|
||||
mobj_t *thing = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
angle_t newValue = luaL_checkangle(L, 2);
|
||||
NOHUD
|
||||
INLEVEL
|
||||
if (!thing)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
P_InitRoll(thing, newValue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_pSlideMove(lua_State *L)
|
||||
{
|
||||
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
|
|
@ -3904,6 +3941,9 @@ static luaL_Reg lib[] = {
|
|||
{"P_TeleportMove",lib_pTeleportMove},
|
||||
{"P_SetOrigin",lib_pSetOrigin},
|
||||
{"P_MoveOrigin",lib_pMoveOrigin},
|
||||
{"P_SetAngle",lib_pSetAngle},
|
||||
{"P_SetPitch",lib_pSetPitch},
|
||||
{"P_SetRoll",lib_pSetRoll},
|
||||
{"P_SlideMove",lib_pSlideMove},
|
||||
{"P_BounceMove",lib_pBounceMove},
|
||||
{"P_CheckSight", lib_pCheckSight},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue