void ThreatManager::tauntApply(Unit* pTaunter) { HostileReference* ref = iThreatContainer.getReferenceByTarget(pTaunter); if(getCurrentVictim() && ref && (ref->getThreat() < getCurrentVictim()->getThreat())) { if(ref->getTempThreatModifyer() == 0.0f) // Ok, temp threat is unused ref->setTempThreat(getCurrentVictim()->getThreat()); } }
// Sorts par exemple 'oubli' void HostileRefManager::addTempThreat(float threat, bool apply) { HostileReference* ref = getFirst(); while (ref) { if (apply) { if (ref->getTempThreatModifyer() == 0.0f) ref->setTempThreatModifier(threat); } else ref->resetTempThreat(); ref = ref->next(); } }