mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-23 19:06:47 +00:00
Do not write custom data for disposed actors
This commit is contained in:
parent
04f2b320b9
commit
ae65b0228a
3 changed files with 13 additions and 1 deletions
|
@ -813,6 +813,12 @@ namespace MWClass
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ptr.getRefData().getCount() <= 0)
|
||||||
|
{
|
||||||
|
state.mHasCustomState = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const CreatureCustomData& customData = ptr.getRefData().getCustomData()->asCreatureCustomData();
|
const CreatureCustomData& customData = ptr.getRefData().getCustomData()->asCreatureCustomData();
|
||||||
|
|
||||||
customData.mContainerStore->writeState (state2.mInventory);
|
customData.mContainerStore->writeState (state2.mInventory);
|
||||||
|
|
|
@ -1331,6 +1331,12 @@ namespace MWClass
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ptr.getRefData().getCount() <= 0)
|
||||||
|
{
|
||||||
|
state.mHasCustomState = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const NpcCustomData& customData = ptr.getRefData().getCustomData()->asNpcCustomData();
|
const NpcCustomData& customData = ptr.getRefData().getCustomData()->asNpcCustomData();
|
||||||
|
|
||||||
customData.mInventoryStore.writeState (state2.mInventory);
|
customData.mInventoryStore.writeState (state2.mInventory);
|
||||||
|
|
|
@ -1197,7 +1197,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
if (!Misc::StringUtils::ciEqual(item.getCellRef().getRefId(), MWWorld::ContainerStore::sGoldId))
|
if (!Misc::StringUtils::ciEqual(item.getCellRef().getRefId(), MWWorld::ContainerStore::sGoldId))
|
||||||
{
|
{
|
||||||
if (victim.isEmpty() || (victim.getClass().isActor() && !victim.getClass().getCreatureStats(victim).isDead()))
|
if (victim.isEmpty() || (victim.getClass().isActor() && victim.getRefData().getCount() > 0 && !victim.getClass().getCreatureStats(victim).isDead()))
|
||||||
mStolenItems[Misc::StringUtils::lowerCase(item.getCellRef().getRefId())][owner] += count;
|
mStolenItems[Misc::StringUtils::lowerCase(item.getCellRef().getRefId())][owner] += count;
|
||||||
}
|
}
|
||||||
if (alarm)
|
if (alarm)
|
||||||
|
|
Loading…
Reference in a new issue