diff --git a/src/lua_baselib.c b/src/lua_baselib.c
index 1a0b539206e833f081de2bbe6eaad1e00c28a66d..594ac6af277617bf8aa790073aa6230af3d5ff55 100644
--- a/src/lua_baselib.c
+++ b/src/lua_baselib.c
@@ -444,7 +444,7 @@ static int lib_pAproxDistance(lua_State *L)
 	fixed_t dx = luaL_checkfixed(L, 1);
 	fixed_t dy = luaL_checkfixed(L, 2);
 	//HUDSAFE
-	lua_pushfixed(L, R_PointToDist2(0, 0, dx, dy));
+	lua_pushfixed(L, P_AproxDistance(dx, dy));
 	return 1;
 }