From 668a947210afe2d7cadd26a3ba9312aad0115f2b Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Wed, 27 Sep 2017 20:00:41 +0400 Subject: [PATCH] Inherit owner, if an item is in container (regression #4128) --- apps/openmw/mwmechanics/mechanicsmanagerimp.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp index 5d9ef726a..574444a8f 100644 --- a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp +++ b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp @@ -1012,14 +1012,17 @@ namespace MWMechanics MWWorld::Ptr victim; + bool isAllowed = true; const MWWorld::CellRef* ownerCellRef = &item.getCellRef(); if (!container.isEmpty()) { // Inherit the owner of the container ownerCellRef = &container.getCellRef(); + isAllowed = isAllowedToUse(ptr, container, victim); } else { + isAllowed = isAllowedToUse(ptr, item, victim); if (!item.getCellRef().hasContentFile()) { // this is a manually placed item, which means it was already stolen @@ -1027,7 +1030,7 @@ namespace MWMechanics } } - if (isAllowedToUse(ptr, item, victim)) + if (isAllowed) return; Owner owner;