mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-28 11:39:40 +00:00
Do not set AiPackageDone flag for non-Aipackages (Fixes #3392)
This commit is contained in:
parent
fcbcc004a3
commit
3b31e8f66e
1 changed files with 10 additions and 10 deletions
|
@ -155,6 +155,13 @@ bool AiSequence::isPackageDone() const
|
|||
return mDone;
|
||||
}
|
||||
|
||||
bool isActualAiPackage(int packageTypeId)
|
||||
{
|
||||
return (packageTypeId != AiPackage::TypeIdCombat
|
||||
&& packageTypeId != AiPackage::TypeIdPursue
|
||||
&& packageTypeId != AiPackage::TypeIdAvoidDoor);
|
||||
}
|
||||
|
||||
void AiSequence::execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration)
|
||||
{
|
||||
if(actor != getPlayer())
|
||||
|
@ -168,11 +175,8 @@ void AiSequence::execute (const MWWorld::Ptr& actor, CharacterController& charac
|
|||
MWMechanics::AiPackage* package = mPackages.front();
|
||||
int packageTypeId = package->getTypeId();
|
||||
// workaround ai packages not being handled as in the vanilla engine
|
||||
if (packageTypeId != AiPackage::TypeIdCombat
|
||||
&& packageTypeId != AiPackage::TypeIdPursue
|
||||
&& packageTypeId != AiPackage::TypeIdAvoidDoor)
|
||||
if (isActualAiPackage(packageTypeId))
|
||||
mLastAiPackage = packageTypeId;
|
||||
|
||||
// if active package is combat one, choose nearest target
|
||||
if (packageTypeId == AiPackage::TypeIdCombat)
|
||||
{
|
||||
|
@ -222,11 +226,6 @@ void AiSequence::execute (const MWWorld::Ptr& actor, CharacterController& charac
|
|||
|
||||
package = mPackages.front();
|
||||
}
|
||||
else
|
||||
{
|
||||
mDone = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (package->execute (actor,characterController,state,duration))
|
||||
|
@ -237,7 +236,8 @@ void AiSequence::execute (const MWWorld::Ptr& actor, CharacterController& charac
|
|||
std::find(mPackages.begin(), mPackages.end(), package);
|
||||
mPackages.erase(toRemove);
|
||||
delete package;
|
||||
mDone = true;
|
||||
if (isActualAiPackage(packageTypeId))
|
||||
mDone = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue