From 502ff88ca94ee91c9ece6ae6c94a9bfe2e595e4e Mon Sep 17 00:00:00 2001 From: data-bomb Date: Sat, 9 Mar 2024 09:04:17 -0800 Subject: [PATCH] Fixes Vote Bugs - Adds Default result - Changes chat option display format - Accounts for last entry in ballot --- Si_AdminMod/ChatVotes.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Si_AdminMod/ChatVotes.cs b/Si_AdminMod/ChatVotes.cs index eb1c957..90a7911 100644 --- a/Si_AdminMod/ChatVotes.cs +++ b/Si_AdminMod/ChatVotes.cs @@ -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; @@ -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(); @@ -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)