fixed former bug

This commit is contained in:
Fleischer Hanno
2024-12-08 21:47:28 +01:00
parent 2c94737023
commit 84c5553154

View File

@@ -76,7 +76,6 @@ public void received(MoveMessage msg) {
logic.getGame().getPlayerByColor(piece.getColor()).setPieceInHome(msg.getTargetIndex(), piece);
} else {
int oldIndex = logic.getGame().getBoard().getInfieldIndexOfPiece(piece);
Piece occ = logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].getOccupant();
if (occ != null) {
//TODO: MoveThrowNotification
@@ -84,7 +83,7 @@ public void received(MoveMessage msg) {
//set occ to waiting
logic.getGame().getPlayerByColor(occ.getColor()).addWaitingPiece(occ);
}
if(msg.getPiece().getState().equals(PieceState.WAITING)){
if(oldIndex == -1){
logic.addNotification(new MovePieceNotification(piece.getUuid(), msg.getTargetIndex(), true));
logic.getGame().getPlayerByColor(piece.getColor()).removeWaitingPiece(piece);
piece.setState(PieceState.ACTIVE);