diff --git a/Content.Shared/_ES/Voting/ESSharedVoteSystem.cs b/Content.Shared/_ES/Voting/ESSharedVoteSystem.cs index 9611ebbe1c..e903b45581 100644 --- a/Content.Shared/_ES/Voting/ESSharedVoteSystem.cs +++ b/Content.Shared/_ES/Voting/ESSharedVoteSystem.cs @@ -137,11 +137,18 @@ public void EndVote(Entity ent) result = _random.Pick(winningOptions); break; case ResultStrategy.WeightedPick: - // Convert each option into a weight based on counts - var weights = ent.Comp.Votes - .Select(p => (p.Key, (float) (1 + p.Value.Count))) // + 1 so every option can be chosen - .ToDictionary(); - result = _random.Pick(weights); + if (ent.Comp.Votes.Values.Sum(p => p.Count) == 0) + { + result = _random.Pick(ent.Comp.VoteOptions); + } + else + { + // Convert each option into a weight based on counts + var weights = ent.Comp.Votes + .Select(p => (p.Key, (float) p.Value.Count)) + .ToDictionary(); + result = _random.Pick(weights); + } break; default: throw new ArgumentOutOfRangeException();