From 9fde4dc1b7127256e2272a40fff35fc254c1f864 Mon Sep 17 00:00:00 2001 From: EmeraldLockdown <86802223+EmeraldLoc@users.noreply.github.com> Date: Mon, 25 Mar 2024 12:38:43 -0500 Subject: [PATCH] Fix sins/coss negative numbers on arm architecture (thanks robertkirkman) (#588) --- src/pc/lua/smlua_functions.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pc/lua/smlua_functions.c b/src/pc/lua/smlua_functions.c index e547d5c01..2b78f69c4 100644 --- a/src/pc/lua/smlua_functions.c +++ b/src/pc/lua/smlua_functions.c @@ -40,7 +40,7 @@ bool smlua_functions_valid_param_range(lua_State* L, int min, int max) { int smlua_func_sins(lua_State* L) { if (!smlua_functions_valid_param_count(L, 1)) { return 0; } - f32 x = smlua_to_number(L, 1); + s16 x = smlua_to_number(L, 1); if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; } lua_pushnumber(L, sins(x)); @@ -50,7 +50,7 @@ int smlua_func_sins(lua_State* L) { int smlua_func_coss(lua_State* L) { if (!smlua_functions_valid_param_count(L, 1)) { return 0; } - f32 x = smlua_to_number(L, 1); + s16 x = smlua_to_number(L, 1); if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; } lua_pushnumber(L, coss(x));