Skip to content

Commit

Permalink
Error fix + Extra Validation
Browse files Browse the repository at this point in the history
See #32
  • Loading branch information
caxanga334 committed Jul 12, 2023
1 parent 19aaa26 commit f1bcc6f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions addons/sourcemod/scripting/customvotes.sp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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]++;

Expand Down

0 comments on commit f1bcc6f

Please sign in to comment.