Fix logic error

This commit is contained in:
Felix Koppe
2024-10-06 22:09:45 +02:00
parent 95fdd86100
commit 7ef06f2440

View File

@@ -201,7 +201,7 @@ void playerReady(Player player, List<Battleship> ships) {
private boolean checkShips(Player player, List<Battleship> ships) {
for(Battleship ship : ships) {
for(Battleship other : ships) {
if(ship.collidesWith(other)) {
if(ship.collidesWith(other) && !ship.equals(other)) {
return false;
}
}