mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'r_ispointinsubsector' into 'next'
Add R_IsPointInSubsector to lua baselib See merge request STJr/SRB2!700
This commit is contained in:
commit
fa74e75648
1 changed files with 15 additions and 0 deletions
|
|
@ -2193,6 +2193,20 @@ static int lib_rPointInSubsector(lua_State *L)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int lib_rIsPointInSubsector(lua_State *L)
|
||||||
|
{
|
||||||
|
fixed_t x = luaL_checkfixed(L, 1);
|
||||||
|
fixed_t y = luaL_checkfixed(L, 2);
|
||||||
|
subsector_t *sub = R_IsPointInSubsector(x, y);
|
||||||
|
//HUDSAFE
|
||||||
|
INLEVEL
|
||||||
|
if (sub)
|
||||||
|
LUA_PushUserdata(L, sub, META_SUBSECTOR);
|
||||||
|
else
|
||||||
|
lua_pushnil(L);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
// R_THINGS
|
// R_THINGS
|
||||||
////////////
|
////////////
|
||||||
|
|
||||||
|
|
@ -3127,6 +3141,7 @@ static luaL_Reg lib[] = {
|
||||||
{"R_PointToDist",lib_rPointToDist},
|
{"R_PointToDist",lib_rPointToDist},
|
||||||
{"R_PointToDist2",lib_rPointToDist2},
|
{"R_PointToDist2",lib_rPointToDist2},
|
||||||
{"R_PointInSubsector",lib_rPointInSubsector},
|
{"R_PointInSubsector",lib_rPointInSubsector},
|
||||||
|
{"R_IsPointInSubsector",lib_rIsPointInSubsector},
|
||||||
|
|
||||||
// r_things (sprite)
|
// r_things (sprite)
|
||||||
{"R_Char2Frame",lib_rChar2Frame},
|
{"R_Char2Frame",lib_rChar2Frame},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue