From a5b147d44d43f3344030ca843478ea2507150dd0 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Thu, 8 Jun 2023 21:56:54 +0200 Subject: [PATCH] Add a clarifying comment --- apps/openmw/mwmechanics/security.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwmechanics/security.cpp b/apps/openmw/mwmechanics/security.cpp index 41e999d4bc..a13131cae6 100644 --- a/apps/openmw/mwmechanics/security.cpp +++ b/apps/openmw/mwmechanics/security.cpp @@ -28,8 +28,9 @@ namespace MWMechanics void Security::pickLock(const MWWorld::Ptr& lock, const MWWorld::Ptr& lockpick, std::string_view& resultMessage, std::string_view& resultSound) { - if (lock.getCellRef().getLockLevel() <= 0 - || !lock.getClass().hasToolTip(lock)) // If it's unlocked or can not be unlocked back out immediately + // If it's unlocked or can not be unlocked back out immediately. Note that we're not strictly speaking checking + // if the ref is locked, lock levels <= 0 can exist but they cannot be picked + if (lock.getCellRef().getLockLevel() <= 0 || !lock.getClass().hasToolTip(lock)) return; int uses = lockpick.getClass().getItemHealth(lockpick);