From ec7301161726eb6198b6adc9d105ad27fa4a1086 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Wed, 27 Jun 2018 12:52:43 +0400 Subject: [PATCH] Clean temporary storage if we assign new AI package (bug #4464) --- CHANGELOG.md | 1 + apps/openmw/mwmechanics/aisequence.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8379b6bea4..6355128367 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ Bug #4458: AiWander console command handles idle chances incorrectly Bug #4459: NotCell dialogue condition doesn't support partial matches Bug #4461: "Open" spell from non-player caster isn't a crime + Bug #4464: OpenMW keeps AiState cached storages even after we cancel AI packages Bug #4469: Abot Silt Striders – Model turn 90 degrees on horizontal Bug #4471: Retrieve SDL window settings instead of using magic numbers Bug #4474: No fallback when getVampireHead fails diff --git a/apps/openmw/mwmechanics/aisequence.cpp b/apps/openmw/mwmechanics/aisequence.cpp index e3b7c63fcb..86cc2bbdcc 100644 --- a/apps/openmw/mwmechanics/aisequence.cpp +++ b/apps/openmw/mwmechanics/aisequence.cpp @@ -360,6 +360,14 @@ void AiSequence::stack (const AiPackage& package, const MWWorld::Ptr& actor, boo } mPackages.push_back (package.clone()); + + // Make sure that temporary storage is empty + if (cancelOther) + { + mAiState.moveIn(new AiCombatStorage()); + mAiState.moveIn(new AiFollowStorage()); + mAiState.moveIn(new AiWanderStorage()); + } } AiPackage* MWMechanics::AiSequence::getActivePackage()