From 439313949622d5b36ea2d8c74a98dcc8781bd8ab Mon Sep 17 00:00:00 2001 From: James McCulloch Date: Fri, 16 Jul 2010 17:13:12 +0000 Subject: [PATCH] * restore error check that I had commented out while experimenting with sqrt approximations --- source/glest_game/ai/route_planner.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/glest_game/ai/route_planner.cpp b/source/glest_game/ai/route_planner.cpp index 763b46d6..8026a6ad 100644 --- a/source/glest_game/ai/route_planner.cpp +++ b/source/glest_game/ai/route_planner.cpp @@ -131,10 +131,9 @@ bool RoutePlanner::isLegalMove(Unit *unit, const Vec2i &pos2) const { assert(unit->getPos().dist(pos2) < 1.5); float d = unit->getPos().dist(pos2); - //if (d > 1.6 || d < 0.7f) { - // printf("\nd = %g", d); - // throw runtime_error("The new Pathfinder lied."); - //} + if (d > 1.5 || d < 0.9f) { + throw runtime_error("The new Pathfinder lied."); + } const Vec2i &pos1 = unit->getPos(); const int &size = unit->getType()->getSize();