Skip to content

Commit

Permalink
Fix the condition where <random map> option is part of a tie.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mnemotechnician committed Jan 5, 2025
1 parent e7c48da commit 0284c6c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Content.Server/Voting/Managers/VoteManager.DefaultVotes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,18 +242,18 @@ private void CreateMapVote(ICommonSession? initiator)
vote.OnFinished += (_, args) =>
{
GameMapPrototype picked;
if (args.Winner == null)
if (args.Winners.Contains(randomMapData)) // Floof section - random map
{
picked = (GameMapPrototype) _random.Pick(args.Winners);
picked = _random.Pick(maps.Keys);
_chatManager.DispatchServerAnnouncement(
Loc.GetString("ui-vote-map-tie", ("picked", maps[picked])));
Loc.GetString("ui-vote-map-random-win", ("picked", maps[picked])));
}
else if (args.Winner == randomMapData) // Floof section - random map
else if (args.Winner == null) // Floof section end
{
picked = _random.Pick(maps.Keys);
picked = (GameMapPrototype) _random.Pick(args.Winners);
_chatManager.DispatchServerAnnouncement(
Loc.GetString("ui-vote-map-random-win", ("picked", maps[picked])));
} // Floof section end
Loc.GetString("ui-vote-map-tie", ("picked", maps[picked])));
}
else
{
picked = (GameMapPrototype) args.Winner;
Expand Down

0 comments on commit 0284c6c

Please sign in to comment.