diff --git a/CHANGELOG.md b/CHANGELOG.md index 1043ca0cf4..e386f8ddbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ 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 #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 0.46.0 diff --git a/apps/openmw/mwclass/container.cpp b/apps/openmw/mwclass/container.cpp index 3adeb19d9f..b4b068c912 100644 --- a/apps/openmw/mwclass/container.cpp +++ b/apps/openmw/mwclass/container.cpp @@ -177,11 +177,10 @@ namespace MWClass } } - if ((isLocked || isTrapped) && hasKey) + if (isLocked && hasKey) { MWBase::Environment::get().getWindowManager ()->messageBox (keyName + " #{sKeyUsed}"); - if(isLocked) - ptr.getCellRef().unlock(); + ptr.getCellRef().unlock(); // using a key disarms the trap if(isTrapped) { diff --git a/apps/openmw/mwclass/door.cpp b/apps/openmw/mwclass/door.cpp index 56712a8151..4f82aa9770 100644 --- a/apps/openmw/mwclass/door.cpp +++ b/apps/openmw/mwclass/door.cpp @@ -158,12 +158,11 @@ namespace MWClass } } - if ((isLocked || isTrapped) && hasKey) + if (isLocked && hasKey) { if(actor == MWMechanics::getPlayer()) 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 if(isTrapped) { diff --git a/components/esm/cellref.cpp b/components/esm/cellref.cpp index 69841528f1..ab6ba27547 100644 --- a/components/esm/cellref.cpp +++ b/components/esm/cellref.cpp @@ -130,7 +130,10 @@ void ESM::CellRef::loadData(ESMReader &esm, bool &isDeleted) } if (mLockLevel == 0 && !mKey.empty()) + { mLockLevel = UnbreakableLock; + mTrap.clear(); + } } void ESM::CellRef::save (ESMWriter &esm, bool wideRefNum, bool inInventory, bool isDeleted) const