mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Fix P_GetZAt for Lua
This commit is contained in:
parent
74fa35221d
commit
4c37c18385
1 changed files with 7 additions and 5 deletions
|
|
@ -2184,16 +2184,18 @@ static int lib_evStartCrumble(lua_State *L)
|
||||||
|
|
||||||
static int lib_pGetZAt(lua_State *L)
|
static int lib_pGetZAt(lua_State *L)
|
||||||
{
|
{
|
||||||
pslope_t *slope = *((pslope_t **)luaL_checkudata(L, 1, META_SLOPE));
|
|
||||||
fixed_t x = luaL_checkfixed(L, 2);
|
fixed_t x = luaL_checkfixed(L, 2);
|
||||||
fixed_t y = luaL_checkfixed(L, 3);
|
fixed_t y = luaL_checkfixed(L, 3);
|
||||||
//HUDSAFE
|
//HUDSAFE
|
||||||
if (slope)
|
if (lua_isnil(L, 1))
|
||||||
lua_pushfixed(L, P_GetSlopeZAt(slope, x, y));
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
fixed_t z = luaL_checkfixed(L, 4);
|
fixed_t z = luaL_checkfixed(L, 4);
|
||||||
lua_pushfixed(L, P_GetZAt(slope, x, y, z));
|
lua_pushfixed(L, P_GetZAt(NULL, x, y, z));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pslope_t *slope = *((pslope_t **)luaL_checkudata(L, 1, META_SLOPE));
|
||||||
|
lua_pushfixed(L, P_GetSlopeZAt(slope, x, y));
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue