From 168375bf0ab8b7745886c39ca9cbe5f11219714f Mon Sep 17 00:00:00 2001 From: Sam Moore Date: Sun, 26 Feb 2012 14:58:08 +0800 Subject: [PATCH] [PATCH] Allow Human_Controller to move scouts further Thanks to David Gow (sulix) for this patch. I was aware of the limitation, but decided to wait until someone complained before fixing it (I also overestimated the effort required to fix it). So I'd like to congratulate David for being the first person to actually try and use the manager program! I'll have to allocate a prize for that. --- judge/manager/human_controller.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/judge/manager/human_controller.cpp b/judge/manager/human_controller.cpp index c2470d3..e2b5845 100644 --- a/judge/manager/human_controller.cpp +++ b/judge/manager/human_controller.cpp @@ -145,6 +145,7 @@ MovementResult Human_Controller::QueryMove(string & buffer) { int xDist = x[1] - x[0]; int yDist = y[1] - y[0]; + int magnitude = max(abs(xDist), abs(yDist)); if (abs(xDist) > abs(yDist)) { if (xDist < 0) @@ -156,6 +157,13 @@ MovementResult Human_Controller::QueryMove(string & buffer) buffer += "UP"; else buffer += "DOWN"; + + if (magnitude > 1) + { + stringstream s(""); + s << " " << magnitude; + buffer += s.str(); + } } mouseClick++; break; -- 2.20.1