Skip to content

Commit

Permalink
Merge pull request #4088 from SJuliez/board-validity
Browse files Browse the repository at this point in the history
MM code adaptation for boards validation
  • Loading branch information
HammerGS committed May 16, 2024
2 parents 66cc701 + 79be7c5 commit 6104b96
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MekHQ/src/mekhq/gui/dialog/EditMapSettingsDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,11 @@ private Image prepareImage(String boardName) {
mapSettings.setBoardSize(boardSize.width(), boardSize.height());
File boardFile = new MegaMekFile(Configuration.boardsDir(), boardName + ".board").getFile();
Board board;
StringBuffer errs = new StringBuffer();
List<String> errors = new ArrayList<>();
if (boardFile.exists()) {
board = new Board();
try (InputStream is = new FileInputStream(boardFile)) {
board.load(is, errs, true);
board.load(is, errors, true);
} catch (IOException ex) {
board = Board.createEmptyBoard(mapSettings.getBoardWidth(), mapSettings.getBoardHeight());
}
Expand Down Expand Up @@ -435,7 +435,7 @@ private Image prepareImage(String boardName) {
// Add the board name label and the server-side board label if necessary
String text = LobbyUtility.cleanBoardName(boardName, mapSettings);
Graphics g = bufImage.getGraphics();
LobbyUtility.drawMinimapLabel(text, bufImage.getWidth(), bufImage.getHeight(), g, errs.length() != 0);
LobbyUtility.drawMinimapLabel(text, bufImage.getWidth(), bufImage.getHeight(), g, !errors.isEmpty());
g.dispose();

synchronized(baseImages) {
Expand Down

0 comments on commit 6104b96

Please sign in to comment.