X-Git-Url: https://git.ucc.asn.au/?p=progcomp2012.git;a=blobdiff_plain;f=progcomp%2Fjudge%2Fmanager%2Fstratego.cpp;h=410b70a29116c32828069680997ce964466cdafd;hp=62da170281d797837fc2ed98899592b38b024d8e;hb=e8a611c553bd336550c50ed7491d5800a2ae7142;hpb=345d8b1f49dfbc4f569c2dae992e896e6c685d55 diff --git a/progcomp/judge/manager/stratego.cpp b/progcomp/judge/manager/stratego.cpp index 62da170..410b70a 100644 --- a/progcomp/judge/manager/stratego.cpp +++ b/progcomp/judge/manager/stratego.cpp @@ -390,6 +390,14 @@ MovementResult Board::MovePiece(int x, int y, const Direction & direction, int m } else { + //Use this to destroy only the attacking piece, and not the bomb + RemovePiece(target); + delete target; + board[x][y] = NULL; + return MovementResult(MovementResult::DIES, attackerType, defenderType); + + /* + //Use this to destroy both the bomb and the attacking piece RemovePiece(defender); RemovePiece(target); delete defender; @@ -397,6 +405,7 @@ MovementResult Board::MovePiece(int x, int y, const Direction & direction, int m board[x][y] = NULL; board[x2][y2] = NULL; return MovementResult(MovementResult::BOTH_DIE, attackerType, defenderType); + */ } } else if (defender->type == Piece::MARSHAL && target->type == Piece::SPY)