1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-31 10:20:13 +00:00

Merge branch 'youonlyneedtounlockonce' into 'master'

Don't unlock unlocked objects now that unlock is no longer idempotent

See merge request 
This commit is contained in:
psi29a 2023-06-11 17:41:23 +00:00
commit 1d5b73f20a
2 changed files with 3 additions and 3 deletions
apps/openmw

@ -954,8 +954,8 @@ namespace MWMechanics
if (caster == getPlayer()) if (caster == getPlayer())
MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicOpenSuccess}"); MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicOpenSuccess}");
target.getCellRef().unlock();
} }
target.getCellRef().unlock();
} }
else else
{ {

@ -366,8 +366,8 @@ namespace MWScript
void execute(Interpreter::Runtime& runtime) override void execute(Interpreter::Runtime& runtime) override
{ {
MWWorld::Ptr ptr = R()(runtime); MWWorld::Ptr ptr = R()(runtime);
if (ptr.getCellRef().isLocked())
ptr.getCellRef().unlock(); ptr.getCellRef().unlock();
} }
}; };