1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00

stopCombat fix

This commit is contained in:
scrawl 2015-01-05 19:33:51 +01:00
parent 365bb3d3f0
commit c343a5c803

View File

@ -125,19 +125,23 @@ bool AiSequence::isInCombat(const MWWorld::Ptr &actor) const
void AiSequence::stopCombat()
{
while (getTypeId() == AiPackage::TypeIdCombat)
for(std::list<AiPackage*>::iterator it = mPackages.begin(); it != mPackages.end(); )
{
delete *mPackages.begin();
mPackages.erase (mPackages.begin());
if ((*it)->getTypeId() == AiPackage::TypeIdCombat)
it = mPackages.erase(it);
else
++it;
}
}
void AiSequence::stopPursuit()
{
while (getTypeId() == AiPackage::TypeIdPursue)
for(std::list<AiPackage*>::iterator it = mPackages.begin(); it != mPackages.end(); )
{
delete *mPackages.begin();
mPackages.erase (mPackages.begin());
if ((*it)->getTypeId() == AiPackage::TypeIdPursue)
it = mPackages.erase(it);
else
++it;
}
}