[8867] Implement expected combat stop with friendly faction

In case force reaction apply/remove.
This commit is contained in:
VladimirMangos 2009-11-23 22:38:34 +03:00
parent 670a2dbb4c
commit e6efe02020
6 changed files with 69 additions and 3 deletions

View file

@ -107,6 +107,24 @@ void HostileRefManager::deleteReferences()
}
}
//=================================================
// delete one reference, defined by faction
void HostileRefManager::deleteReferencesForFaction(uint32 faction)
{
HostileReference* ref = getFirst();
while(ref)
{
HostileReference* nextRef = ref->next();
if(ref->getSource()->getOwner()->getFactionTemplateEntry()->faction == faction)
{
ref->removeReference();
delete ref;
}
ref = nextRef;
}
}
//=================================================
// delete one reference, defined by Unit