forked from teamnwah/openmw-tes3coop
Closes #1115: Fix a bug causing number of AI packages to grow exponentially when adding an AI package. Not sure if adding the same package twice should even be allowed.
This commit is contained in:
parent
f070d9966d
commit
fe66012bcd
1 changed files with 3 additions and 0 deletions
|
@ -109,7 +109,10 @@ void MWMechanics::AiSequence::stack (const AiPackage& package)
|
||||||
for(std::list<AiPackage *>::iterator it = mPackages.begin(); it != mPackages.end(); it++)
|
for(std::list<AiPackage *>::iterator it = mPackages.begin(); it != mPackages.end(); it++)
|
||||||
{
|
{
|
||||||
if(mPackages.front()->getPriority() <= package.getPriority())
|
if(mPackages.front()->getPriority() <= package.getPriority())
|
||||||
|
{
|
||||||
mPackages.insert(it,package.clone());
|
mPackages.insert(it,package.clone());
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mPackages.empty())
|
if(mPackages.empty())
|
||||||
|
|
Loading…
Reference in a new issue