mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 12:53:53 +00:00
Fix AI being able to open locked doors (Fixes #2948)
This commit is contained in:
parent
ee450471fd
commit
8459a79a2c
1 changed files with 2 additions and 1 deletions
|
@ -88,7 +88,8 @@ void MWMechanics::AiPackage::evadeObstacles(const MWWorld::Ptr& actor, float dur
|
||||||
MWWorld::Ptr door = getNearbyDoor(actor);
|
MWWorld::Ptr door = getNearbyDoor(actor);
|
||||||
if (door != MWWorld::Ptr()) // NOTE: checks interior cells only
|
if (door != MWWorld::Ptr()) // NOTE: checks interior cells only
|
||||||
{
|
{
|
||||||
if (!door.getCellRef().getTeleport() && door.getCellRef().getTrap().empty() && door.getClass().getDoorState(door) == 0) { //Open the door if untrapped
|
if (!door.getCellRef().getTeleport() && door.getCellRef().getTrap().empty()
|
||||||
|
&& door.getCellRef().getLockLevel() <= 0 && door.getClass().getDoorState(door) == 0) {
|
||||||
MWBase::Environment::get().getWorld()->activateDoor(door, 1);
|
MWBase::Environment::get().getWorld()->activateDoor(door, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue