Some clean up related to the entity_list changes

This commit is contained in:
Michael Cook (mackal) 2014-02-10 12:16:14 -05:00
parent ce4f4995b5
commit 6a8a6e530b
4 changed files with 5 additions and 20 deletions

View File

@ -427,7 +427,6 @@ Client::~Client() {
eqs->Close();
eqs->ReleaseFromUse();
//entity_list.RemoveClient(this);
UninitializeBuffSlots();
}

View File

@ -2031,12 +2031,12 @@ bool EntityList::RemoveMob(uint16 delete_id)
auto it = mob_list.find(delete_id);
if (it != mob_list.end()) {
if (npc_list.find(delete_id) != npc_list.end())
if (npc_list.count(delete_id))
entity_list.RemoveNPC(delete_id);
else if (client_list.find(delete_id) != client_list.end())
else if (client_list.count(delete_id))
entity_list.RemoveClient(delete_id);
safe_delete(it->second);
if (corpse_list.find(delete_id) == corpse_list.end())
if (corpse_list.count(delete_id))
free_ids.push(it->first);
mob_list.erase(it);
return true;
@ -2054,7 +2054,7 @@ bool EntityList::RemoveMob(Mob *delete_mob)
while (it != mob_list.end()) {
if (it->second == delete_mob) {
safe_delete(it->second);
if (corpse_list.find(it->first) == corpse_list.end())
if (corpse_list.count(it->first))
free_ids.push(it->first);
mob_list.erase(it);
return true;

View File

@ -385,16 +385,6 @@ Mob::Mob(const char* in_name,
Mob::~Mob()
{
// Our Entity ID is set to 0 in NPC::Death. This leads to mobs hanging around for a while in
// the entity list, even after they have been destroyed. Use our memory pointer to remove the mob
// if our EntityID is 0.
//
/*if(GetID() > 0)
entity_list.RemoveMob(GetID());
else
entity_list.RemoveMob(this);*/
AI_Stop();
if (GetPet()) {
if (GetPet()->Charmed())
@ -402,7 +392,7 @@ Mob::~Mob()
else
SetPet(0);
}
ClearSpecialAbilities();
EQApplicationPacket app;

View File

@ -353,7 +353,6 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, float x, float y, float z, float
NPC::~NPC()
{
//entity_list.RemoveNPC(GetID());
AI_Stop();
if(proximity != nullptr) {
@ -361,9 +360,6 @@ NPC::~NPC()
safe_delete(proximity);
}
//clear our spawn limit record if we had one.
//entity_list.LimitRemoveNPC(this);
safe_delete(NPCTypedata_ours);
{