fixed a bug where the home index of piece was wrong

This commit is contained in:
Fleischer Hanno
2024-12-08 21:18:34 +01:00
parent 992efd403d
commit 5e67b2d0c7

View File

@@ -178,7 +178,7 @@ public boolean hasPieceInWaitingArea(){
public int getHomeIndexOfPiece(Piece piece) {
for (int i = 0; i < Resources.MAX_PIECES; i++) {
if (this.homeNodes[i].getOccupant().equals(piece)) {
if (piece.equals(this.homeNodes[i].getOccupant())) {
return i;
}
}