mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-30 01:06:44 +00:00
Clean up summoned creatures when corpses are disposed
This commit is contained in:
parent
1097c2cfc4
commit
120b7dcd2f
1 changed files with 6 additions and 0 deletions
|
@ -248,6 +248,12 @@ namespace MWGui
|
|||
MWScript::InterpreterContext interpreterContext (&mPtr.getRefData().getLocals(), mPtr);
|
||||
MWBase::Environment::get().getScriptManager()->run (script, interpreterContext);
|
||||
}
|
||||
|
||||
// Clean up summoned creatures as well
|
||||
std::map<MWMechanics::CreatureStats::SummonKey, int>& creatureMap = creatureStats.getSummonedCreatureMap();
|
||||
for (const auto& creature : creatureMap)
|
||||
MWBase::Environment::get().getMechanicsManager()->cleanupSummonedCreature(mPtr, creature.second);
|
||||
creatureMap.clear();
|
||||
}
|
||||
|
||||
MWBase::Environment::get().getWorld()->deleteObject(mPtr);
|
||||
|
|
Loading…
Reference in a new issue