From f1bcc6f2731a87002f0be04bfd5c3179aaede37d Mon Sep 17 00:00:00 2001 From: caxanga334 <10157643+caxanga334@users.noreply.github.com> Date: Tue, 11 Jul 2023 21:53:01 -0300 Subject: [PATCH] Error fix + Extra Validation See #32 --- addons/sourcemod/scripting/customvotes.sp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/sourcemod/scripting/customvotes.sp b/addons/sourcemod/scripting/customvotes.sp index 9673191..20f8bb5 100644 --- a/addons/sourcemod/scripting/customvotes.sp +++ b/addons/sourcemod/scripting/customvotes.sp @@ -1539,8 +1539,9 @@ public int VoteHandler_Map(Handle hMenu, MenuAction iAction, int iVoter, int iPa for(int client = 0; client <= MaxClients; client++) { g_bVoteForMap[client][g_iCurrentVoteIndex][g_iCurrentVoteMap] = false; - g_iCurrentVoteIndex = g_iCurrentVoteMap = -1; } + + g_iCurrentVoteIndex = g_iCurrentVoteMap = -1; } return 0; } @@ -2641,7 +2642,7 @@ public bool CheckVotesForMap(int iVote, int iMap) return false; } */ - if(iVotes >= iRequired) + if(iVotes >= iRequired && iVote == g_iCurrentVoteIndex) // Don't run vote pass logic if the vote index is not the current active vote { g_iVotePasses[iVote]++;