1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-30 21:45:33 +00:00

Fix priority bug in AiSequence::stack (Fixes #1959)

This commit is contained in:
scrawl 2014-09-30 22:57:38 +02:00
parent c826de49a5
commit ee8b85aa2c

View file

@ -260,14 +260,13 @@ void AiSequence::stack (const AiPackage& package, const MWWorld::Ptr& actor)
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((*it)->getPriority() <= package.getPriority())
{ {
mPackages.insert(it,package.clone()); mPackages.insert(it,package.clone());
return; return;
} }
} }
if(mPackages.empty())
mPackages.push_front (package.clone()); mPackages.push_front (package.clone());
} }