fixed former bug
This commit is contained in:
@@ -76,7 +76,6 @@ public void received(MoveMessage msg) {
|
|||||||
logic.getGame().getPlayerByColor(piece.getColor()).setPieceInHome(msg.getTargetIndex(), piece);
|
logic.getGame().getPlayerByColor(piece.getColor()).setPieceInHome(msg.getTargetIndex(), piece);
|
||||||
} else {
|
} else {
|
||||||
int oldIndex = logic.getGame().getBoard().getInfieldIndexOfPiece(piece);
|
int oldIndex = logic.getGame().getBoard().getInfieldIndexOfPiece(piece);
|
||||||
|
|
||||||
Piece occ = logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].getOccupant();
|
Piece occ = logic.getGame().getBoard().getInfield()[msg.getTargetIndex()].getOccupant();
|
||||||
if (occ != null) {
|
if (occ != null) {
|
||||||
//TODO: MoveThrowNotification
|
//TODO: MoveThrowNotification
|
||||||
@@ -84,7 +83,7 @@ public void received(MoveMessage msg) {
|
|||||||
//set occ to waiting
|
//set occ to waiting
|
||||||
logic.getGame().getPlayerByColor(occ.getColor()).addWaitingPiece(occ);
|
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.addNotification(new MovePieceNotification(piece.getUuid(), msg.getTargetIndex(), true));
|
||||||
logic.getGame().getPlayerByColor(piece.getColor()).removeWaitingPiece(piece);
|
logic.getGame().getPlayerByColor(piece.getColor()).removeWaitingPiece(piece);
|
||||||
piece.setState(PieceState.ACTIVE);
|
piece.setState(PieceState.ACTIVE);
|
||||||
|
|||||||
Reference in New Issue
Block a user