Skip to content

Commit

Permalink
Randomize all maps when there is only one player (#583)
Browse files Browse the repository at this point in the history
* Update GameLobbyBase.cs

When playerCount = 1, will get all maps, not only maps with maxplayers = 2

* Update GameLobbyBase.cs

Add a line break after }
  • Loading branch information
Flactine authored Dec 6, 2024
1 parent 10882a5 commit 9bee9dc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions DXMainClient/DXGUI/Multiplayer/GameLobby/GameLobbyBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,12 @@ private void PickRandomMap()

private List<Map> GetMapList(int playerCount)
{
if (playerCount == 1)
{
List<Map> allMaps = GameMode?.Maps.ToList() ?? new List<Map>();
return allMaps;
}

List<Map> mapList = (GameMode?.Maps.Where(x => x.MaxPlayers == playerCount) ?? Array.Empty<Map>()).ToList();
if (mapList.Count < 1 && playerCount <= MAX_PLAYER_COUNT)
return GetMapList(playerCount + 1);
Expand Down

0 comments on commit 9bee9dc

Please sign in to comment.