1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-19 20:53:52 +00:00

Merge pull request #2775 from Capostrophic/dooractivation

Only disarm traps with keys when the door/container is locked (bug #5370)
This commit is contained in:
Bret Curtis 2020-04-24 08:46:24 +02:00 committed by GitHub
commit e7795f2bf7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 6 deletions

View file

@ -8,6 +8,7 @@
Bug #5364: Script fails/stops if trying to startscript an unknown script Bug #5364: Script fails/stops if trying to startscript an unknown script
Bug #5367: Selecting a spell on an enchanted item per hotkey always plays the equip sound Bug #5367: Selecting a spell on an enchanted item per hotkey always plays the equip sound
Bug #5369: Spawnpoint in the Grazelands doesn't produce oversized creatures Bug #5369: Spawnpoint in the Grazelands doesn't produce oversized creatures
Bug #5370: Opening an unlocked but trapped door uses the key
Feature #5362: Show the soul gems' trapped soul in count dialog Feature #5362: Show the soul gems' trapped soul in count dialog
0.46.0 0.46.0

View file

@ -177,10 +177,9 @@ namespace MWClass
} }
} }
if ((isLocked || isTrapped) && hasKey) if (isLocked && hasKey)
{ {
MWBase::Environment::get().getWindowManager ()->messageBox (keyName + " #{sKeyUsed}"); MWBase::Environment::get().getWindowManager ()->messageBox (keyName + " #{sKeyUsed}");
if(isLocked)
ptr.getCellRef().unlock(); ptr.getCellRef().unlock();
// using a key disarms the trap // using a key disarms the trap
if(isTrapped) if(isTrapped)

View file

@ -158,11 +158,10 @@ namespace MWClass
} }
} }
if ((isLocked || isTrapped) && hasKey) if (isLocked && hasKey)
{ {
if(actor == MWMechanics::getPlayer()) if(actor == MWMechanics::getPlayer())
MWBase::Environment::get().getWindowManager()->messageBox(keyName + " #{sKeyUsed}"); MWBase::Environment::get().getWindowManager()->messageBox(keyName + " #{sKeyUsed}");
if(isLocked)
ptr.getCellRef().unlock(); //Call the function here. because that makes sense. ptr.getCellRef().unlock(); //Call the function here. because that makes sense.
// using a key disarms the trap // using a key disarms the trap
if(isTrapped) if(isTrapped)

View file

@ -130,7 +130,10 @@ void ESM::CellRef::loadData(ESMReader &esm, bool &isDeleted)
} }
if (mLockLevel == 0 && !mKey.empty()) if (mLockLevel == 0 && !mKey.empty())
{
mLockLevel = UnbreakableLock; mLockLevel = UnbreakableLock;
mTrap.clear();
}
} }
void ESM::CellRef::save (ESMWriter &esm, bool wideRefNum, bool inInventory, bool isDeleted) const void ESM::CellRef::save (ESMWriter &esm, bool wideRefNum, bool inInventory, bool isDeleted) const