|
|
|
@ -992,14 +992,19 @@ namespace MWMechanics
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool MechanicsManager::isItemStolenFrom(const std::string &itemid, const std::string &ownerid)
|
|
|
|
|
bool MechanicsManager::isItemStolenFrom(const std::string &itemid, const MWWorld::Ptr& ptr)
|
|
|
|
|
{
|
|
|
|
|
StolenItemsMap::const_iterator it = mStolenItems.find(Misc::StringUtils::lowerCase(itemid));
|
|
|
|
|
if (it == mStolenItems.end())
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
const OwnerMap& owners = it->second;
|
|
|
|
|
const std::string ownerid = ptr.getCellRef().getRefId();
|
|
|
|
|
const std::string factionid = ptr.getClass().getPrimaryFaction(ptr);
|
|
|
|
|
OwnerMap::const_iterator ownerFound = owners.find(std::make_pair(Misc::StringUtils::lowerCase(ownerid), false));
|
|
|
|
|
return ownerFound != owners.end();
|
|
|
|
|
OwnerMap::const_iterator factionOwnerFound = owners.find(std::make_pair(Misc::StringUtils::lowerCase(factionid), true));
|
|
|
|
|
|
|
|
|
|
return ownerFound != owners.end() || factionOwnerFound != owners.end();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MechanicsManager::confiscateStolenItemToOwner(const MWWorld::Ptr &player, const MWWorld::Ptr &item, const MWWorld::Ptr& victim, int count)
|
|
|
|
|