From 5843b3e121b0bc1caec6835d4050272d0728550a Mon Sep 17 00:00:00 2001 From: Andrew Guibert Date: Sun, 6 May 2018 12:44:57 -0500 Subject: [PATCH] Show player list even if 0 human players are in game --- .../game/core/OutboundMessage.java | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/game-service/src/main/java/org/libertybikes/game/core/OutboundMessage.java b/game-service/src/main/java/org/libertybikes/game/core/OutboundMessage.java index 72f1315..1f753f9 100644 --- a/game-service/src/main/java/org/libertybikes/game/core/OutboundMessage.java +++ b/game-service/src/main/java/org/libertybikes/game/core/OutboundMessage.java @@ -11,18 +11,13 @@ public class OutboundMessage { public final Player[] playerlist; public PlayerList(Set players) { - if (players.size() > 0) { - // Send players in proper order, padding out empty slots with "Bot Player" - playerlist = new Player[Player.MAX_PLAYERS]; - for (Player p : players) - playerlist[p.playerNum] = p; - for (int i = 0; i < Player.MAX_PLAYERS; i++) - if (playerlist[i] == null) - playerlist[i] = new Player("", "Bot Player", (short) i, 0, 0); - } else { - // If no players are in the game yet, do not show all bot players - playerlist = new Player[0]; - } + // Send players in proper order, padding out empty slots with "Bot Player" + playerlist = new Player[Player.MAX_PLAYERS]; + for (Player p : players) + playerlist[p.playerNum] = p; + for (int i = 0; i < Player.MAX_PLAYERS; i++) + if (playerlist[i] == null) + playerlist[i] = new Player("", "Bot Player", (short) i, 0, 0); } }