Check for AiPackage type before find nearby door

pull/541/head
elsid 5 years ago
parent cb0a609d59
commit 389f5dfb9b
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

@ -224,6 +224,10 @@ void MWMechanics::AiPackage::evadeObstacles(const MWWorld::Ptr& actor)
void MWMechanics::AiPackage::openDoors(const MWWorld::Ptr& actor) void MWMechanics::AiPackage::openDoors(const MWWorld::Ptr& actor)
{ {
// note: AiWander currently does not open doors
if (getTypeId() == TypeIdWander)
return;
MWBase::World* world = MWBase::Environment::get().getWorld(); MWBase::World* world = MWBase::Environment::get().getWorld();
static float distance = world->getMaxActivationDistance(); static float distance = world->getMaxActivationDistance();
@ -231,8 +235,7 @@ void MWMechanics::AiPackage::openDoors(const MWWorld::Ptr& actor)
if (door == MWWorld::Ptr()) if (door == MWWorld::Ptr())
return; return;
// note: AiWander currently does not open doors if (!door.getCellRef().getTeleport() && door.getClass().getDoorState(door) == MWWorld::DoorState::Idle)
if (getTypeId() != TypeIdWander && !door.getCellRef().getTeleport() && door.getClass().getDoorState(door) == MWWorld::DoorState::Idle)
{ {
if ((door.getCellRef().getTrap().empty() && door.getCellRef().getLockLevel() <= 0 )) if ((door.getCellRef().getTrap().empty() && door.getCellRef().getLockLevel() <= 0 ))
{ {

Loading…
Cancel
Save