From 3db74f943d2e51ffaf0fc3c8672aef31f7b65810 Mon Sep 17 00:00:00 2001 From: Franco Romaniello Date: Sun, 20 Jun 2021 21:19:43 -0300 Subject: [PATCH] Fix rg_round_end winstatus none winstatus 0 is a valid status --- reapi/include/cssdk/dlls/gamerules.h | 3 ++- reapi/src/natives/natives_misc.cpp | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/reapi/include/cssdk/dlls/gamerules.h b/reapi/include/cssdk/dlls/gamerules.h index 5755581..6778601 100644 --- a/reapi/include/cssdk/dlls/gamerules.h +++ b/reapi/include/cssdk/dlls/gamerules.h @@ -55,7 +55,8 @@ enum { - WINSTATUS_CTS = 1, + WINSTATUS_NONE = 0, + WINSTATUS_CTS, WINSTATUS_TERRORISTS, WINSTATUS_DRAW, }; diff --git a/reapi/src/natives/natives_misc.cpp b/reapi/src/natives/natives_misc.cpp index e159cdc..456a1df 100644 --- a/reapi/src/natives/natives_misc.cpp +++ b/reapi/src/natives/natives_misc.cpp @@ -421,8 +421,9 @@ cell AMX_NATIVE_CALL rg_round_end(AMX *amx, cell *params) CHECK_GAMERULES(); auto winstatus = params[arg_win]; - if (winstatus <= 0) { - AMXX_LogError(amx, AMX_ERR_NATIVE, "%s: unknown win status %i", __FUNCTION__, winstatus); + + if (winstatus < WINSTATUS_NONE || winstatus > WINSTATUS_DRAW) { + AMXX_LogError(amx, AMX_ERR_NATIVE, "%s: invalid winstatus %i, bounds(%i, %i)", __FUNCTION__, winstatus, WINSTATUS_NONE, WINSTATUS_DRAW); return FALSE; }