Back to TPG

TPG.Voting.TallyVotes

S🏷️ Voting

Part of TPG namespace

TPG.Voting.TallyVotes()
View on GitHub|gamemode/voting/sv_voting.lua:294-330
📋 Has LDoc👁️ 0 viewsUpdated 1 month ago

Description

Close the map vote, pick the winner, announce it, and change level. Tie-break trap: the winner scan uses >=, not >, so on a tie the LAST candidate reached with the highest count wins, not the first -- a straight iteration in list order means later candidates beat earlier ones on equal votes. bestMap starts at 1 with bestVotes = 0, so a round with zero votes cast still "wins" for candidate 1 rather than falling back to the current map. Schedules changelevel 3 seconds later via timer.Simple so the announcement has time to reach chat first.

Parameters

No parameters.

Returns

No return values documented.

Examples

No examples available.

Used In

No usages found in the codebase.