mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
I keep seeing a crash due to an invalidated iter during mob delete every few days, seeing if this fixes it.
This commit is contained in:
parent
7feb531ff7
commit
ec8c46abfe
@ -497,7 +497,6 @@ void EntityList::MobProcess()
|
||||
if (!it->second->Process()) {
|
||||
Mob *mob = it->second;
|
||||
uint16 tempid = it->first;
|
||||
++it; // we don't erase here because the destructor will
|
||||
if (mob->IsNPC()) {
|
||||
entity_list.RemoveNPC(mob->CastToNPC()->GetID());
|
||||
} else if (mob->IsMerc()) {
|
||||
@ -525,7 +524,12 @@ void EntityList::MobProcess()
|
||||
}
|
||||
entity_list.RemoveClient(mob->GetID());
|
||||
}
|
||||
entity_list.RemoveMob(tempid);
|
||||
|
||||
if(entity_list.RemoveMob(tempid)) {
|
||||
it = mob_list.begin();
|
||||
} else {
|
||||
++it;
|
||||
}
|
||||
} else {
|
||||
++it;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user