Inherit owner, if an item is in container (regression #4128)

experimental
Andrei Kortunov 7 years ago
parent f2146a2dc0
commit 668a947210

@ -1012,14 +1012,17 @@ namespace MWMechanics
MWWorld::Ptr victim; MWWorld::Ptr victim;
bool isAllowed = true;
const MWWorld::CellRef* ownerCellRef = &item.getCellRef(); const MWWorld::CellRef* ownerCellRef = &item.getCellRef();
if (!container.isEmpty()) if (!container.isEmpty())
{ {
// Inherit the owner of the container // Inherit the owner of the container
ownerCellRef = &container.getCellRef(); ownerCellRef = &container.getCellRef();
isAllowed = isAllowedToUse(ptr, container, victim);
} }
else else
{ {
isAllowed = isAllowedToUse(ptr, item, victim);
if (!item.getCellRef().hasContentFile()) if (!item.getCellRef().hasContentFile())
{ {
// this is a manually placed item, which means it was already stolen // 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; return;
Owner owner; Owner owner;

Loading…
Cancel
Save