mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 04:41:23 +00:00
Added P_GetMobjGravity to Lua. Check /toaster/gravitytest.lua for sample script.
This commit is contained in:
parent
7071fbe29e
commit
62c4338d60
1 changed files with 12 additions and 0 deletions
|
@ -13,6 +13,7 @@
|
|||
#include "doomdef.h"
|
||||
#ifdef HAVE_BLUA
|
||||
#include "p_local.h"
|
||||
#include "p_mobj.h" // So we can have P_GetMobjGravity
|
||||
#include "p_setup.h" // So we can have P_SetupLevelSky
|
||||
#include "z_zone.h"
|
||||
#include "r_main.h"
|
||||
|
@ -437,6 +438,16 @@ static int lib_pMobjFlip(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int lib_pGetMobjGravity(lua_State *L)
|
||||
{
|
||||
mobj_t *mobj = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
//HUDSAFE
|
||||
if (!mobj)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
lua_pushinteger(L, P_GetMobjGravity(mobj));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_pWeaponOrPanel(lua_State *L)
|
||||
{
|
||||
mobjtype_t type = luaL_checkinteger(L, 1);
|
||||
|
@ -2008,6 +2019,7 @@ static luaL_Reg lib[] = {
|
|||
{"P_SPMAngle",lib_pSPMAngle},
|
||||
{"P_SpawnPlayerMissile",lib_pSpawnPlayerMissile},
|
||||
{"P_MobjFlip",lib_pMobjFlip},
|
||||
{"P_GetMobjGravity",lib_pGetMobjGravity},
|
||||
{"P_WeaponOrPanel",lib_pWeaponOrPanel},
|
||||
{"P_FlashPal",lib_pFlashPal},
|
||||
{"P_GetClosestAxis",lib_pGetClosestAxis},
|
||||
|
|
Loading…
Reference in a new issue