mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
Don't purge summon effects with invalid creature ids
This commit is contained in:
parent
f089c94d34
commit
580fa78034
1 changed files with 6 additions and 0 deletions
|
@ -145,6 +145,12 @@ namespace MWMechanics
|
||||||
|
|
||||||
for (std::map<ESM::SummonKey, int>::iterator it = creatureMap.begin(); it != creatureMap.end(); )
|
for (std::map<ESM::SummonKey, int>::iterator it = creatureMap.begin(); it != creatureMap.end(); )
|
||||||
{
|
{
|
||||||
|
if(it->second == -1)
|
||||||
|
{
|
||||||
|
// Keep the spell effect active if we failed to spawn anything
|
||||||
|
it++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->searchPtrViaActorId(it->second);
|
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->searchPtrViaActorId(it->second);
|
||||||
if (ptr.isEmpty() || (ptr.getClass().getCreatureStats(ptr).isDead() && ptr.getClass().getCreatureStats(ptr).isDeathAnimationFinished()))
|
if (ptr.isEmpty() || (ptr.getClass().getCreatureStats(ptr).isDead() && ptr.getClass().getCreatureStats(ptr).isDeathAnimationFinished()))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue