had it wrong before, was meant to be total_votes and not num_votes
This commit is contained in:
parent
a5a856073e
commit
6a5cbf74f1
@ -1893,15 +1893,22 @@ public void Handler_MapVoteFinished(Handle menu,
|
|||||||
}
|
}
|
||||||
delete sm;
|
delete sm;
|
||||||
|
|
||||||
|
int total_votes = 0;
|
||||||
|
for (int i = 0; i < MaxClients; i++)
|
||||||
|
{
|
||||||
|
if (IsValidClient(i) && !is_bot_player[i])
|
||||||
|
{
|
||||||
|
total_votes += GetPlayerWorthRTV_boost_(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Implement revote logic - Only run this` block if revotes are enabled and this isn't the last revote'
|
// Implement revote logic - Only run this` block if revotes are enabled and this isn't the last revote'
|
||||||
//LogMessage("Mapchooser_extended_avg Handler_MapVoteFinished.");
|
|
||||||
int required_percent = GetConVarInt(g_Cvar_RunOffPercent);
|
int required_percent = GetConVarInt(g_Cvar_RunOffPercent);
|
||||||
|
|
||||||
int most_voted_map_percentage = ((weighted_votes[0] / num_votes) * 100);
|
int most_voted_map_percentage = (weighted_votes[0] / total_votes) * 100;
|
||||||
if(GetConVarBool(g_Cvar_RunOff) && g_RunoffCount < GetConVarInt(g_Cvar_MaxRunOffs) && num_items > 1 && g_ChangeTime != MapChange_MapEnd &&
|
if(GetConVarBool(g_Cvar_RunOff) && g_RunoffCount < GetConVarInt(g_Cvar_MaxRunOffs) && num_items > 1 && g_ChangeTime != MapChange_MapEnd &&
|
||||||
(weighted_votes[0] == weighted_votes[1] || most_voted_map_percentage < required_percent))
|
(weighted_votes[0] == weighted_votes[1] || most_voted_map_percentage < required_percent))
|
||||||
{
|
{
|
||||||
//LogMessage("Mapchooser_extended_avg Handler_MapVoteFinished passed check1.");
|
|
||||||
g_RunoffCount++;
|
g_RunoffCount++;
|
||||||
if(weighted_votes[0] == weighted_votes[1])
|
if(weighted_votes[0] == weighted_votes[1])
|
||||||
{
|
{
|
||||||
@ -1959,7 +1966,7 @@ public void Handler_MapVoteFinished(Handle menu,
|
|||||||
g_WaitingForVote = false;
|
g_WaitingForVote = false;
|
||||||
//LogMessage("Mapchooser_extended_avg no revote needed, continue as normal.");
|
//LogMessage("Mapchooser_extended_avg no revote needed, continue as normal.");
|
||||||
// No revote needed, continue as normal.
|
// No revote needed, continue as normal.
|
||||||
Handler_VoteFinishedGeneric(weighted_maps[0], num_votes, weighted_votes[0]); //change again
|
Handler_VoteFinishedGeneric(weighted_maps[0], total_votes, weighted_votes[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Handler_MapVoteMenu(Handle menu, MenuAction action, int param1, int param2)
|
public int Handler_MapVoteMenu(Handle menu, MenuAction action, int param1, int param2)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user