1
0
Fork 0
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:
scrawl 2015-10-13 19:05:17 +02:00
parent ee450471fd
commit 8459a79a2c

View file

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