1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-21 08:39:42 +00:00

Merge pull request #2156 from Capostrophic/itemtaken

Fix redundant searchPtr call
This commit is contained in:
Bret Curtis 2019-02-05 12:29:51 +01:00 committed by GitHub
commit a206f57f75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1190,8 +1190,7 @@ namespace MWMechanics
if (!Misc::StringUtils::ciEqual(item.getCellRef().getRefId(), MWWorld::ContainerStore::sGoldId)) if (!Misc::StringUtils::ciEqual(item.getCellRef().getRefId(), MWWorld::ContainerStore::sGoldId))
{ {
const MWWorld::Ptr victimRef = MWBase::Environment::get().getWorld()->searchPtr(ownerCellRef->getOwner(), true); if (victim.isEmpty() || (victim.getClass().isActor() && !victim.getClass().getCreatureStats(victim).isDead()))
if (victimRef.isEmpty() || !victimRef.getClass().getCreatureStats(victimRef).isDead())
mStolenItems[Misc::StringUtils::lowerCase(item.getCellRef().getRefId())][owner] += count; mStolenItems[Misc::StringUtils::lowerCase(item.getCellRef().getRefId())][owner] += count;
} }
if (alarm) if (alarm)