mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-22 12:39:59 +00:00
Merge branch 'fix-6633' into 'master'
Fix #6633: AiSequence packages being removed incorrectly Closes #6633 See merge request OpenMW/openmw!1678
This commit is contained in:
commit
85c0d93274
@ -315,9 +315,16 @@ void AiSequence::execute (const MWWorld::Ptr& actor, CharacterController& charac
|
|||||||
mPackages.push_back(package->clone());
|
mPackages.push_back(package->clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
// To account for the rare case where AiPackage::execute() queued another AI package
|
// The active package is typically the first entry, this is however not always the case
|
||||||
// (e.g. AiPursue executing a dialogue script that uses startCombat)
|
// e.g. AiPursue executing a dialogue script that uses startCombat adds a combat package to the front
|
||||||
erase(mPackages.begin());
|
// due to the priority.
|
||||||
|
auto activePackageIt = std::find_if(mPackages.begin(), mPackages.end(), [&](auto& entry)
|
||||||
|
{
|
||||||
|
return entry.get() == package;
|
||||||
|
});
|
||||||
|
|
||||||
|
erase(activePackageIt);
|
||||||
|
|
||||||
if (isActualAiPackage(packageTypeId))
|
if (isActualAiPackage(packageTypeId))
|
||||||
mDone = true;
|
mDone = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user