diff --git a/makefile b/makefile index cc59d0d..ec0993a 100644 --- a/makefile +++ b/makefile @@ -29,6 +29,9 @@ test-jar: jar # $(JR) -cp "$(OUT_DIR)/:$(LIB_DIR)/*" $(MAIN_CLASS) $(JR) -jar $(OUT_DIR)/$(JAR_NAME) +docs: + javadoc -cp "$(LIB_DIR)/*" -d "docs" $(SRC_DIR)/*.java + test: classfiles $(JR) -cp "$(OUT_DIR)$(SEPERATOR)$(LIB_DIR)/*" $(MAIN_CLASS) diff --git a/src/AiPlayer.java b/src/AiPlayer.java index 071f896..a1c9690 100644 --- a/src/AiPlayer.java +++ b/src/AiPlayer.java @@ -155,6 +155,7 @@ public abstract class AiPlayer extends LocalPlayer implements Runnable { while(i.hasNext()) { Thread thread = i.next(); try { + thread.interrupt(); thread.join(); i.remove(); } catch (InterruptedException e) { diff --git a/src/BoardDisplay.java b/src/BoardDisplay.java index 5295ad7..d0eeedd 100644 --- a/src/BoardDisplay.java +++ b/src/BoardDisplay.java @@ -174,6 +174,7 @@ public class BoardDisplay extends JPanel { if(currentShip != null) { test = currentShip.getVirtualOccupiedPoints(mousePosition, horizontal); } + if (player == null || player.getBoard() == null) return; for(int i = 0; i < gridSize; i++) { for(int j = 0; j < gridSize; j++) { if(fields[i][j] == null) { diff --git a/src/MainFrame.java b/src/MainFrame.java index 004c068..f327e0b 100644 --- a/src/MainFrame.java +++ b/src/MainFrame.java @@ -129,7 +129,7 @@ public class MainFrame extends JFrame { * @author Lucas Bronson, Peer Ole Wachtel, Luca Conte */ public void showPanelWin(String panelName, Player player){ - if(player != gameBoard.getP1()){ + if(gameBoard == null || player != gameBoard.getP1()){ return; } @@ -152,7 +152,7 @@ public class MainFrame extends JFrame { * @author Lucas Bronson, Peer Ole Wachtel, Luca Conte */ public void showPanelLose(String panelName, Player player){ - if(player != gameBoard.getP1()){ + if(gameBoard == null || player != gameBoard.getP1()){ return; }