From 97cd9d434a8cbcf689dd046afb0fb216451d29f8 Mon Sep 17 00:00:00 2001 From: elsid Date: Sun, 25 Aug 2019 13:49:04 +0200 Subject: [PATCH] Do not open doors when actor has no path When actor is not going anywhere it doesn't require to go through doors so there is no need to open them. --- apps/openmw/mwmechanics/aipackage.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/openmw/mwmechanics/aipackage.cpp b/apps/openmw/mwmechanics/aipackage.cpp index 97523f2d6..ef22d986a 100644 --- a/apps/openmw/mwmechanics/aipackage.cpp +++ b/apps/openmw/mwmechanics/aipackage.cpp @@ -228,6 +228,9 @@ void MWMechanics::AiPackage::openDoors(const MWWorld::Ptr& actor) if (getTypeId() == TypeIdWander) return; + if (mPathFinder.getPathSize() == 0) + return; + MWBase::World* world = MWBase::Environment::get().getWorld(); static float distance = world->getMaxActivationDistance();