mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Revert "[2.1.15] Restore backwards compatibility for tan()"
This reverts commit 5e50a51386
.
This commit is contained in:
parent
5e50a51386
commit
d253571b38
1 changed files with 3 additions and 9 deletions
|
@ -81,15 +81,9 @@ static int lib_finecosine(lua_State *L)
|
||||||
|
|
||||||
static int lib_finetangent(lua_State *L)
|
static int lib_finetangent(lua_State *L)
|
||||||
{
|
{
|
||||||
// 2.1.15 ONLY HACK: optional boolean argument, only add ANGLE_90 if true
|
// HACK: add ANGLE_90 to make tan() in Lua start at 0 like it should
|
||||||
boolean newtan = lua_optboolean(L, 2);
|
// use & 4095 instead of & FINEMASK (8191), so it doesn't go out of the array's bounds
|
||||||
|
lua_pushfixed(L, FINETANGENT(((luaL_checkangle(L, 1)+ANGLE_90)>>ANGLETOFINESHIFT) & 4095));
|
||||||
if (newtan)
|
|
||||||
// HACK: add ANGLE_90 to make tan() in Lua start at 0 like it should
|
|
||||||
// use & 4095 instead of & FINEMASK (8191), so it doesn't go out of the array's bounds
|
|
||||||
lua_pushfixed(L, FINETANGENT(((luaL_checkangle(L, 1)+ANGLE_90)>>ANGLETOFINESHIFT) & 4095));
|
|
||||||
else
|
|
||||||
lua_pushfixed(L, FINETANGENT((luaL_checkangle(L, 1)>>ANGLETOFINESHIFT) & 4095));
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue