mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
Fix P_GetZAt for Lua
This commit is contained in:
parent
d0abd6e86c
commit
435643b958
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)
|
||||
{
|
||||
pslope_t *slope = *((pslope_t **)luaL_checkudata(L, 1, META_SLOPE));
|
||||
fixed_t x = luaL_checkfixed(L, 2);
|
||||
fixed_t y = luaL_checkfixed(L, 3);
|
||||
//HUDSAFE
|
||||
if (slope)
|
||||
lua_pushfixed(L, P_GetSlopeZAt(slope, x, y));
|
||||
else
|
||||
if (lua_isnil(L, 1))
|
||||
{
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue