Fix annoying aura crash that has been around for a year and a half, add aura logging, utilize close lists

This commit is contained in:
Akkadius
2020-01-19 21:57:28 -06:00
parent 6c91786cfb
commit 6f73278cf8
7 changed files with 471 additions and 244 deletions
+431 -242
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -73,7 +73,7 @@ private:
int m_owner;
int aura_id; // spell ID of the aura spell -1 if aura isn't from a casted spell
int spell_id; // spell we cast
int distance; // distance we remove
float distance; // distance we remove
Timer remove_timer; // when we depop
Timer process_timer; // rate limit process calls
Timer cast_timer; // some auras pulse
+18
View File
@@ -2624,6 +2624,24 @@ bool EntityList::RemoveMobFromCloseLists(Mob *mob)
return false;
}
/**
* @param mob
* @return
*/
void EntityList::RemoveAuraFromMobs(Mob *aura)
{
LogEntityManagement(
"Attempting to remove aura [{}] from mobs entity_id ({})",
aura->GetCleanName(),
aura->GetID()
);
for (auto &it : mob_list) {
auto mob = it.second;
mob->RemoveAura(aura->GetID());
}
}
/**
* @param close_mobs
* @param scanning_mob
+1 -1
View File
@@ -293,6 +293,7 @@ public:
bool RemoveObject(uint16 delete_id);
bool RemoveProximity(uint16 delete_npc_id);
bool RemoveMobFromCloseLists(Mob *mob);
void RemoveAuraFromMobs(Mob *aura);
void RemoveAllMobs();
void RemoveAllClients();
void RemoveAllNPCs();
@@ -584,7 +585,6 @@ private:
private:
std::list<Bot*> bot_list;
#endif
};
class BulkZoneSpawnPacket {
+2
View File
@@ -503,6 +503,8 @@ Mob::~Mob()
UninitializeBuffSlots();
entity_list.RemoveMobFromCloseLists(this);
entity_list.RemoveAuraFromMobs(this);
close_mobs.clear();
#ifdef BOTS