From a06cb541b15bc603b26536a40ec05a5d66562d02 Mon Sep 17 00:00:00 2001 From: Titus Tscharntke Date: Tue, 22 Feb 2011 16:18:44 +0000 Subject: [PATCH] units with move skill have higher priority while selecting now than those without move skill ( typically buildings ) --- source/glest_game/gui/gui.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/glest_game/gui/gui.cpp b/source/glest_game/gui/gui.cpp index c3f17196..ff0d13fd 100644 --- a/source/glest_game/gui/gui.cpp +++ b/source/glest_game/gui/gui.cpp @@ -971,8 +971,15 @@ bool Gui::computeTarget(const Vec2i &screenPos, Vec2i &targetPos, const Unit *&t validPosObjWorld= false; if(uc.empty() == false) { - targetUnit= uc.front(); - targetPos= targetUnit->getPos(); + + for(int i=0; igetPos(); + if(targetUnit->getType()->hasSkillClass(scMove)) + {// moving units are more relevant than non moving ones + break; + } + } return true; } else if(obj!=NULL) {