forked from mirror/openmw-tes3mp
[Client] Don't remove SummonKeys with actorIds of -1
This prevents summon duplication caused by a SummonKey sometimes being deleted immediately after being created, before the server can send back an ObjectSpawn packet spawning a creature that can be attached to the SummonKey.
This commit is contained in:
parent
c2411982d2
commit
76731f5def
1 changed files with 16 additions and 0 deletions
|
@ -183,6 +183,22 @@ namespace MWMechanics
|
|||
|
||||
for (std::map<CreatureStats::SummonKey, int>::iterator it = creatureMap.begin(); it != creatureMap.end(); )
|
||||
{
|
||||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
If we're iterating over a SummonKey matching an actorId of -1, that means it's a summon
|
||||
yet to be sent back to us by the server and we should skip over it, because deleting it
|
||||
here would mean it becomes just a regular creature when the server sends it back to us
|
||||
*/
|
||||
if (it->second == -1)
|
||||
{
|
||||
++it;
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
End of tes3mp addition
|
||||
*/
|
||||
|
||||
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->searchPtrViaActorId(it->second);
|
||||
if (ptr.isEmpty() || (ptr.getClass().getCreatureStats(ptr).isDead() && ptr.getClass().getCreatureStats(ptr).isDeathAnimationFinished()))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue