Commit 104208fc by Sal

Use R_PointToDist2 instead

Apparently overflows less often
parent d6c49706
......@@ -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;
}
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment