From c239a71ffe395c3bab79b8418279c3433e6b6adb Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 25 May 2016 16:34:09 +0100 Subject: [PATCH] Add P_PointOnLineSide to Lua --- src/lua_baselib.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 1bacf9102..e083530a9 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -205,6 +205,16 @@ static int lib_pClosestPointOnLine(lua_State *L) return 2; } +static int lib_pPointOnLineSide(lua_State *L) +{ + fixed_t x = luaL_checkfixed(L, 1); + fixed_t y = luaL_checkfixed(L, 2); + line_t *line = *((line_t **)luaL_checkudata(L, 3, META_LINE)); + //HUDSAFE + lua_pushinteger(L, P_PointOnLineSide(x, y, line)); + return 1; +} + // P_ENEMY ///////////// @@ -1981,6 +1991,7 @@ static luaL_Reg lib[] = { // p_maputil {"P_AproxDistance",lib_pAproxDistance}, {"P_ClosestPointOnLine",lib_pClosestPointOnLine}, + {"P_PointOnLineSide",lib_pPointOnLineSide}, // p_enemy {"P_CheckMeleeRange", lib_pCheckMeleeRange},