Restrict opening doors to bipedal actors (Fixes #4313)

pull/395/head
Capostrophic 7 years ago committed by GitHub
parent 9b8c56761b
commit 5b49248d6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -189,7 +189,7 @@ void MWMechanics::AiPackage::evadeObstacles(const MWWorld::Ptr& actor, float dur
static float distance = MWBase::Environment::get().getWorld()->getMaxActivationDistance();
MWWorld::Ptr door = getNearbyDoor(actor, distance);
if (door != MWWorld::Ptr())
if (door != MWWorld::Ptr() && actor.getClass().isBipedal(actor))
{
// note: AiWander currently does not open doors
if (getTypeId() != TypeIdWander && !door.getCellRef().getTeleport() && door.getClass().getDoorState(door) == 0)
@ -224,7 +224,7 @@ void MWMechanics::AiPackage::evadeObstacles(const MWWorld::Ptr& actor, float dur
MWBase::Environment::get().getWorld()->activate(door, actor);
}
}
else // any other obstacle (NPC, crate, etc.)
else
{
mObstacleCheck.takeEvasiveAction(movement);
}

Loading…
Cancel
Save