From 4719686440205e753035d1e3a9863e61585b8c97 Mon Sep 17 00:00:00 2001 From: Titus Tscharntke Date: Tue, 29 Mar 2011 22:12:55 +0000 Subject: [PATCH] enemy targeting changed a bit again --- source/glest_game/world/unit_updater.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index c2eb5905..3827b00f 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -561,6 +561,10 @@ void UnitUpdater::unitBeingAttacked(std::pair &result, const Unit * distToUnit = unit->getCenteredPos().dist(enemy->getCenteredPos()); result.first = true; result.second = enemy; + if( ast->getAttackRange()>=distToUnit) + { + break; + } } } }