units with move skill have higher priority while selecting now than those without move skill ( typically buildings )

This commit is contained in:
Titus Tscharntke 2011-02-22 16:18:44 +00:00
parent bd29260fef
commit a06cb541b1
1 changed files with 9 additions and 2 deletions

View File

@ -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; i<uc.size(); ++i){
targetUnit= uc.at(i);
targetPos= targetUnit->getPos();
if(targetUnit->getType()->hasSkillClass(scMove))
{// moving units are more relevant than non moving ones
break;
}
}
return true;
}
else if(obj!=NULL) {