mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 06:21:28 +00:00
Pointer removals
This commit is contained in:
parent
d9a1cf8c7b
commit
d47daa2857
@ -2282,6 +2282,9 @@ bool EntityList::RemoveMob(uint16 delete_id)
|
|||||||
|
|
||||||
auto it = mob_list.find(delete_id);
|
auto it = mob_list.find(delete_id);
|
||||||
if (it != mob_list.end()) {
|
if (it != mob_list.end()) {
|
||||||
|
|
||||||
|
RemoveMobFromClientCloseLists(it->second);
|
||||||
|
|
||||||
if (npc_list.count(delete_id))
|
if (npc_list.count(delete_id))
|
||||||
entity_list.RemoveNPC(delete_id);
|
entity_list.RemoveNPC(delete_id);
|
||||||
else if (client_list.count(delete_id))
|
else if (client_list.count(delete_id))
|
||||||
@ -2304,6 +2307,8 @@ bool EntityList::RemoveMob(Mob *delete_mob)
|
|||||||
auto it = mob_list.begin();
|
auto it = mob_list.begin();
|
||||||
while (it != mob_list.end()) {
|
while (it != mob_list.end()) {
|
||||||
if (it->second == delete_mob) {
|
if (it->second == delete_mob) {
|
||||||
|
RemoveMobFromClientCloseLists(it->second);
|
||||||
|
|
||||||
safe_delete(it->second);
|
safe_delete(it->second);
|
||||||
if (!corpse_list.count(it->first))
|
if (!corpse_list.count(it->first))
|
||||||
free_ids.push(it->first);
|
free_ids.push(it->first);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user