mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
[Crash] Check mob pointer before trying to remove it (#4230)
This commit is contained in:
parent
e64f03fcc0
commit
3a5381d38a
@ -2675,6 +2675,10 @@ void EntityList::RemoveAllMobs()
|
||||
{
|
||||
auto it = mob_list.begin();
|
||||
while (it != mob_list.end()) {
|
||||
if (!it->second) {
|
||||
++it;
|
||||
continue;
|
||||
}
|
||||
safe_delete(it->second);
|
||||
free_ids.push(it->first);
|
||||
it = mob_list.erase(it);
|
||||
@ -2812,6 +2816,9 @@ bool EntityList::RemoveMob(uint16 delete_id)
|
||||
|
||||
auto it = mob_list.find(delete_id);
|
||||
if (it != mob_list.end()) {
|
||||
if (!it->second) {
|
||||
return false;
|
||||
}
|
||||
if (npc_list.count(delete_id)) {
|
||||
entity_list.RemoveNPC(delete_id);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user