Changed SpecialAttacks to an array instead of a map. Basic access was causing a hotspot. Brief testing doesn't show any obvious bugs but let me know if any prop up.

This commit is contained in:
KimLS
2014-02-12 15:26:08 -08:00
parent 9461067fdb
commit 275f9d6aaf
3 changed files with 51 additions and 77 deletions
+13 -1
View File
@@ -40,6 +40,18 @@ public:
enum eStandingPetOrder { SPO_Follow, SPO_Sit, SPO_Guard };
struct SpecialAbility {
SpecialAbility() {
level = 0;
timer = nullptr;
for(int i = 0; i < MAX_SPECIAL_ATTACK_PARAMS; ++i) {
params[i] = 0;
}
}
~SpecialAbility() {
safe_delete(timer);
}
int level;
Timer *timer;
int params[MAX_SPECIAL_ATTACK_PARAMS];
@@ -1177,7 +1189,7 @@ protected:
void InsertQuestGlobal(int charid, int npcid, int zoneid, const char *name, const char *value, int expdate);
uint16 emoteid;
std::map<int, SpecialAbility> SpecialAbilities;
SpecialAbility SpecialAbilities[MAX_SPECIAL_ATTACK];
bool bEnraged;
bool destructibleobject;