Skip to content

Commit

Permalink
Fixes Vote Bugs
Browse files Browse the repository at this point in the history
- Adds Default result
- Changes chat option display format
- Accounts for last entry in ballot
  • Loading branch information
data-bomb committed Mar 9, 2024
1 parent e23e9a5 commit 502ff88
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Si_AdminMod/ChatVotes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static void HoldVote(ChatVoteBallot ballot)

// create the results we'll fill in as we go
currentVoteResults = new ChatVoteResults();
currentVoteResults.DetailedResults = new OptionVoteResult[ballot.Options.Length];
currentVoteResults.DetailedResults = new OptionVoteResult[ballot.Options.Length + 1];
currentVoteResults.VoteHandler = ballot.VoteHandler;

int index = 0;
Expand All @@ -111,7 +111,7 @@ public static void HoldVote(ChatVoteBallot ballot)
PlayerMethods.RegisterPlayerPhrase(optionPair.Command, voteChatCallback, true);

// TODO: consider sending these at a slower pace than all at once
HelperMethods.ReplyToCommand(optionPair.Command, " ", optionPair.Description);
HelperMethods.ReplyToCommand(optionPair.Command, " -- ", optionPair.Description);
}

StartVoteDurationTimer();
Expand Down Expand Up @@ -142,7 +142,8 @@ private static void HandleVoteTimerExpired(object? source, ElapsedEventArgs e)

OptionVoteResult winningResult = new OptionVoteResult
{
Votes = -1
Votes = -1,
Command = "invalid"
};

foreach (OptionVoteResult currentVoteResult in currentVoteResults.DetailedResults)
Expand Down

0 comments on commit 502ff88

Please sign in to comment.