[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
+4 -4
View File
@@ -1511,7 +1511,7 @@ typedef enum { //AA IDs
} aaID;
//Structure representing the database's swarm pet configs
struct AA_SwarmPet {
struct SwarmPet_Struct {
uint8 count; //number to summon
uint32 npc_id; //id from npc_types to represent it.
uint16 duration; //how long they last, in seconds
@@ -1526,10 +1526,10 @@ enum { //values of AA_Action.action
class Timer;
class Mob;
class AA_SwarmPetInfo {
class SwarmPet {
public:
AA_SwarmPetInfo();
~AA_SwarmPetInfo();
SwarmPet();
~SwarmPet();
Mob * GetOwner();
Timer *duration;
uint32 target; //the target ID