[Performance] Fixed a large overhead issue where every single NPC in a zone was checking to depop themselves

as a swarm pet every 3ms regardless of being a swarm pet or not. Swarm pets now check to depop only when their timer is up
This commit is contained in:
Akkadius
2017-03-28 02:30:06 -05:00
parent 4b6ce1c19e
commit bf45a5a44f
7 changed files with 86 additions and 73 deletions
+1
View File
@@ -2557,6 +2557,7 @@ void NPC::ClearLastName()
void NPC::DepopSwarmPets()
{
if (GetSwarmInfo()) {
if (GetSwarmInfo()->duration->Check(false)){
Mob* owner = entity_list.GetMobID(GetSwarmInfo()->owner_id);