mirror of
https://github.com/mangosfour/server.git
synced 2025-12-28 22:37:04 +00:00
[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:
parent
68b701f5d1
commit
d0bdf7611a
3 changed files with 36 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
//============================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue