From b612f601389cde4cea441bc4bb10ea7dedcecd1e Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Sat, 27 Apr 2024 18:33:27 +0800 Subject: [PATCH] [server] Implement and match `n_atan2(...)` --- server/scrcustom.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/scrcustom.cpp b/server/scrcustom.cpp index 1c28dec..b71aa16 100644 --- a/server/scrcustom.cpp +++ b/server/scrcustom.cpp @@ -165,8 +165,9 @@ static cell AMX_NATIVE_CALL n_acos(AMX *amx, cell *params) static cell AMX_NATIVE_CALL n_atan2(AMX *amx, cell *params) { - // TODO: atan2 - return 0; + CHECK_PARAMS(2); + float fResult = (float)(atan2(amx_ctof(params[1]), amx_ctof(params[2])) * (180.0f / PI)); + return amx_ftoc(fResult); } static cell AMX_NATIVE_CALL n_atan(AMX *amx, cell *params)