From c14536a399b317d2a2d724333ca17602fbd92307 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sun, 3 Jun 2018 13:02:27 +0300 Subject: [PATCH] Update faction-owned items confiscation --- apps/openmw/mwmechanics/mechanicsmanagerimp.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp index 8da2c86d2..4a773bdc7 100644 --- a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp +++ b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp @@ -1029,6 +1029,13 @@ namespace MWMechanics owner.first = victim.getCellRef().getRefId(); owner.second = false; + const std::string victimFaction = victim.getClass().getPrimaryFaction(victim); + if (!victimFaction.empty() && Misc::StringUtils::ciEqual(item.getCellRef().getFaction(), victimFaction)) // Is the item faction-owned? + { + owner.first = victimFaction; + owner.second = true; + } + Misc::StringUtils::lowerCaseInPlace(owner.first); // decrease count of stolen items