diff --git a/judge/manager/stratego.cpp b/judge/manager/stratego.cpp index e142a4bd67cc3e39e51cff3d3b2e82a20476e1b2..7894378e01981ff103023646e2b4c7bc75cd8222 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.