From 1c81f192d86d232e26b9daef8b8ee94d6d0ece41 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Fri, 6 May 2016 21:52:00 -0700 Subject: [PATCH] it isn't settled until you add in the deprecation warning --- src/lua_mathlib.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lua_mathlib.c b/src/lua_mathlib.c index 8ae432fc5..b98c51529 100644 --- a/src/lua_mathlib.c +++ b/src/lua_mathlib.c @@ -85,11 +85,16 @@ static int lib_finetangent(lua_State *L) boolean newtan = lua_optboolean(L, 2); 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_Deprecated(L, "tan(angle)", "tan(angle, true)"); lua_pushfixed(L, FINETANGENT((luaL_checkangle(L, 1)>>ANGLETOFINESHIFT) & 4095)); + } return 1; }