X-Git-Url: https://git.ucc.asn.au/?p=progcomp2012.git;a=blobdiff_plain;f=judge%2Fmanager%2Fstratego.cpp;h=7894378e01981ff103023646e2b4c7bc75cd8222;hp=e142a4bd67cc3e39e51cff3d3b2e82a20476e1b2;hb=037a4b52ab76fe90955d671604238e02f3e4f5a2;hpb=85cfed04e179dad45eefd9fdf747628addbf93fb diff --git a/judge/manager/stratego.cpp b/judge/manager/stratego.cpp index e142a4b..7894378 100644 --- a/judge/manager/stratego.cpp +++ b/judge/manager/stratego.cpp @@ -343,6 +343,8 @@ MovementResult Board::MovePiece(int x, int y, const Direction & direction, int m { return MovementResult(MovementResult::IMMOBILE_UNIT); } + if (multiplier < 1) + return MovementResult(MovementResult::INVALID_DIRECTION); //Don't allow moves that don't actually move forward if (multiplier > 1 && target->type != Piece::SCOUT) { return MovementResult(MovementResult::INVALID_DIRECTION); //Can only move a scout multiple times.