1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-18 18:40:06 +00:00

Only disarm traps with keys when the door is locked (bug #5370)

This commit is contained in:
Capostrophic 2020-04-12 14:40:06 +03:00
parent 4e22f03ece
commit 5dc8da5f67
3 changed files with 5 additions and 6 deletions

View File

@ -6,6 +6,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,11 +177,10 @@ 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,12 +158,11 @@ 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)
{ {