HostilReference* ThreatContainer::modifyThreatPercent(Unit *pVictim, int32 pPercent) { HostilReference* ref = getReferenceByTarget(pVictim); assert(ref); // for a modification the reference must be there. (or not?) ref->addThreatPercent(pPercent); return ref; }
HostileReference* ThreatContainer::addThreat(Unit* pVictim, float pThreat) { HostileReference* ref = getReferenceByTarget(pVictim); if (ref) ref->addThreat(pThreat); return ref; }
void ThreatContainer::modifyThreatPercent(Unit* victim, int32 percent) { if (HostileReference* ref = getReferenceByTarget(victim)) ref->addThreatPercent(percent); }
void ThreatContainer::modifyThreatPercent(Unit* pVictim, int32 pPercent) { if (HostileReference* ref = getReferenceByTarget(pVictim)) { if (pPercent < -100) { ref->removeReference(); delete ref; } else ref->addThreatPercent(pPercent); } }