Use R_PointToDist2 instead

Apparently overflows less often
This commit is contained in:
Sally Coolatta 2020-11-07 23:56:46 -05:00
parent d6c497065e
commit 104208fc84
2 changed files with 3 additions and 3 deletions

View file

@ -238,8 +238,8 @@ static int lib_pAproxDistance(lua_State *L)
fixed_t dx = luaL_checkfixed(L, 1);
fixed_t dy = luaL_checkfixed(L, 2);
//HUDSAFE
LUA_Deprecated(L, "P_AproxDistance", "FixedHypot");
lua_pushfixed(L, FixedHypot(dx, dy));
LUA_Deprecated(L, "P_AproxDistance", "R_PointToDist2");
lua_pushfixed(L, R_PointToDist2(0, 0, dx, dy));
return 1;
}

View file

@ -41,7 +41,7 @@ typedef boolean (*traverser_t)(intercept_t *in);
boolean P_PathTraverse(fixed_t px1, fixed_t py1, fixed_t px2, fixed_t py2,
INT32 pflags, traverser_t ptrav);
#define P_AproxDistance(dx, dy) FixedHypot(dx, dy)
#define P_AproxDistance(dx, dy) R_PointToDist2(0, 0, dx, dy)
void P_ClosestPointOnLine(fixed_t x, fixed_t y, line_t *line, vertex_t *result);
void P_ClosestPointOnLine3D(fixed_t x, fixed_t y, fixed_t z, line_t *line, vertex_t *result);
INT32 P_PointOnLineSide(fixed_t x, fixed_t y, line_t *line);