mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-22 11:39:39 +00:00
Merge pull request #2715 from akortunov/cleanup
Remove custom data for disposed actors
This commit is contained in:
commit
6bc04507ef
3 changed files with 13 additions and 1 deletions
|
@ -809,6 +809,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();
|
||||||
ESM::CreatureState& creatureState = state.asCreatureState();
|
ESM::CreatureState& creatureState = state.asCreatureState();
|
||||||
customData.mContainerStore->writeState (creatureState.mInventory);
|
customData.mContainerStore->writeState (creatureState.mInventory);
|
||||||
|
|
|
@ -1327,6 +1327,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();
|
||||||
ESM::NpcState& npcState = state.asNpcState();
|
ESM::NpcState& npcState = state.asNpcState();
|
||||||
customData.mInventoryStore.writeState (npcState.mInventory);
|
customData.mInventoryStore.writeState (npcState.mInventory);
|
||||||
|
|
|
@ -1217,7 +1217,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