From 037a4b52ab76fe90955d671604238e02f3e4f5a2 Mon Sep 17 00:00:00 2001 From: Sam Moore Date: Thu, 2 Feb 2012 18:29:52 +0800 Subject: [PATCH 1/1] Added check for rubbish move multipliers --- judge/manager/stratego.cpp | 2 ++ 1 file changed, 2 insertions(+) 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. -- 2.20.1