- added validation for unit's to ensure they still have the cached commandclass
This commit is contained in:
parent
914649b647
commit
c1529fd8dc
|
@ -986,7 +986,8 @@ Unit * Faction::findClosestUnitWithSkillClass( const Vec2i &pos,const CommandCla
|
||||||
Unit *curUnit = findUnit(iter->second);
|
Unit *curUnit = findUnit(iter->second);
|
||||||
if(curUnit != NULL) {
|
if(curUnit != NULL) {
|
||||||
|
|
||||||
bool isUnitPossibleCandidate = true;
|
const CommandType *cmdType = curUnit->getType()->getFirstCtOfClass(cmdClass);
|
||||||
|
bool isUnitPossibleCandidate = (cmdType != NULL);
|
||||||
if(skillClassList.size() > 0) {
|
if(skillClassList.size() > 0) {
|
||||||
isUnitPossibleCandidate = false;
|
isUnitPossibleCandidate = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user