mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-20 19:02:34 +00:00
Use R_PointToDist2 for the Lua versions of P_AproxDistance and FixedHypot
This commit is contained in:
parent
a58df577fe
commit
758de501da
2 changed files with 3 additions and 2 deletions
|
@ -432,7 +432,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, P_AproxDistance(dx, dy));
|
||||
lua_pushfixed(L, R_PointToDist2(0, 0, dx, dy));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "tables.h"
|
||||
#include "p_local.h"
|
||||
#include "doomstat.h" // for ALL7EMERALDS
|
||||
#include "r_main.h" // for R_PointToDist2
|
||||
|
||||
#include "lua_script.h"
|
||||
#include "lua_libs.h"
|
||||
|
@ -129,7 +130,7 @@ static int lib_fixedsqrt(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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue