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.
pull/541/head
elsid 5 years ago
parent 389f5dfb9b
commit 97cd9d434a
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

@ -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();

Loading…
Cancel
Save