Use R_PointToDist2 for the Lua versions of P_AproxDistance and FixedHypot
This commit is contained in:
parent
a58df577fe
commit
758de501da
|
@ -432,7 +432,7 @@ static int lib_pAproxDistance(lua_State *L)
|
||||||
fixed_t dx = luaL_checkfixed(L, 1);
|
fixed_t dx = luaL_checkfixed(L, 1);
|
||||||
fixed_t dy = luaL_checkfixed(L, 2);
|
fixed_t dy = luaL_checkfixed(L, 2);
|
||||||
//HUDSAFE
|
//HUDSAFE
|
||||||
lua_pushfixed(L, P_AproxDistance(dx, dy));
|
lua_pushfixed(L, R_PointToDist2(0, 0, dx, dy));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "tables.h"
|
#include "tables.h"
|
||||||
#include "p_local.h"
|
#include "p_local.h"
|
||||||
#include "doomstat.h" // for ALL7EMERALDS
|
#include "doomstat.h" // for ALL7EMERALDS
|
||||||
|
#include "r_main.h" // for R_PointToDist2
|
||||||
|
|
||||||
#include "lua_script.h"
|
#include "lua_script.h"
|
||||||
#include "lua_libs.h"
|
#include "lua_libs.h"
|
||||||
|
@ -129,7 +130,7 @@ static int lib_fixedsqrt(lua_State *L)
|
||||||
|
|
||||||
static int lib_fixedhypot(lua_State *L)
|
static int lib_fixedhypot(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_pushfixed(L, FixedHypot(luaL_checkfixed(L, 1), luaL_checkfixed(L, 2)));
|
lua_pushfixed(L, R_PointToDist2(0, 0, luaL_checkfixed(L, 1), luaL_checkfixed(L, 2)));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue