- added validation for unit's to ensure they still have the cached commandclass

This commit is contained in:
Mark Vejvoda 2010-11-16 23:32:15 +00:00
parent 914649b647
commit c1529fd8dc
1 changed files with 2 additions and 1 deletions

View File

@ -986,7 +986,8 @@ Unit * Faction::findClosestUnitWithSkillClass( const Vec2i &pos,const CommandCla
Unit *curUnit = findUnit(iter->second);
if(curUnit != NULL) {
bool isUnitPossibleCandidate = true;
const CommandType *cmdType = curUnit->getType()->getFirstCtOfClass(cmdClass);
bool isUnitPossibleCandidate = (cmdType != NULL);
if(skillClassList.size() > 0) {
isUnitPossibleCandidate = false;