Skip to content

Commit

Permalink
fixed bug with Battleship moves only being reported if it was a hit
Browse files Browse the repository at this point in the history
  • Loading branch information
Zomis committed May 12, 2015
1 parent 78d8b26 commit dab69b5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/java/net/zomis/server/games/BattleshipGame.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ private boolean makeMove(String fullCommand, int player, int x, int y) {
it.remove();
}
}
if (hit) {
this.send(fullCommand + " " + player + " " + (hit ? "HIT" : "MISS"));
}
this.send(fullCommand + " " + player + " " + (hit ? "HIT" : "MISS"));
sunkenShips.forEach(ship -> send("MOVE", String.format(Locale.ENGLISH, "SINK %d %s %d %d %d %d", player,
ship.getName(), ship.getWidth(), ship.getHeight(), ship.getX(), ship.getY())));

Expand Down

0 comments on commit dab69b5

Please sign in to comment.