From 5dc8da5f672f73a844864493d4938a7962a7275c Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sun, 12 Apr 2020 14:40:06 +0300 Subject: [PATCH] Only disarm traps with keys when the door is locked (bug #5370) --- CHANGELOG.md | 1 + apps/openmw/mwclass/container.cpp | 5 ++--- apps/openmw/mwclass/door.cpp | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 675766ad98..e49ba92ee4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,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 7d1c1d38a5..19ba5351a0 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) {