[11918] Let creatures evade when the enemy is unreachable

This commit is not great, but will be improved hopefully soon.
However it seems that it doesn't really cause problems, it is just not as good as it should be!
This commit is contained in:
sixsixnine 2012-01-30 00:10:01 +01:00 committed by Schmoozerd
parent 68b701f5d1
commit d0bdf7611a
3 changed files with 36 additions and 2 deletions

View file

@ -252,7 +252,15 @@ HostileReference* ThreatContainer::addThreat(Unit* pVictim, float pThreat)
void ThreatContainer::modifyThreatPercent(Unit *pVictim, int32 pPercent)
{
if(HostileReference* ref = getReferenceByTarget(pVictim))
ref->addThreatPercent(pPercent);
{
if(pPercent < -100)
{
ref->removeReference();
delete ref;
}
else
ref->addThreatPercent(pPercent);
}
}
//============================================================