Changeset 72 for trunk/src/game/ThreatManager.cpp
- Timestamp:
- 11/19/08 13:31:37 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/ThreatManager.cpp
r44 r72 268 268 HostilReference* currentRef = NULL; 269 269 bool found = false; 270 271 std::list<HostilReference*>::iterator lastRef = iThreatList.end(); 272 lastRef--; 273 270 274 for(std::list<HostilReference*>::iterator iter = iThreatList.begin(); iter != iThreatList.end() && !found; ++iter) 271 275 { … … 274 278 Unit* target = currentRef->getTarget(); 275 279 assert(target); // if the ref has status online the target must be there ! 280 281 // some units are prefered in comparison to others 282 if(iter != lastRef && (target->IsImmunedToDamage(pAttacker->GetMeleeDamageSchoolMask(), false) || 283 target->hasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING) 284 ) ) 285 { 286 // current victim is a second choice target, so don't compare threat with it below 287 if(currentRef == pCurrentVictim) 288 pCurrentVictim = NULL; 289 continue; 290 } 276 291 277 292 if(!pAttacker->IsOutOfThreatArea(target)) // skip non attackable currently targets