From 78803c9f09feff5213a394a84e28b8245f7e2efa Mon Sep 17 00:00:00 2001 From: Shocker Date: Tue, 28 Sep 2010 08:21:51 +0300 Subject: Magic numbers cleanup: - Replace many magic numbers with constants - Use enum for vehicle flags/seat flags - Correct structure for ItemRandomSuffixEntry --HG-- branch : trunk --- src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp | 2 +- src/server/game/AI/ScriptedAI/ScriptedSimpleAI.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/server/game/AI/ScriptedAI') diff --git a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp index 864de9288a1..524d4148d71 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp @@ -205,7 +205,7 @@ void SimpleAI::UpdateAI(const uint32 diff) return; //Spells - for (uint32 i = 0; i < 10; ++i) + for (uint32 i = 0; i < MAX_SIMPLEAI_SPELLS; ++i) { //Spell not valid if (!Spell[i].Enabled || !Spell[i].Spell_Id) diff --git a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.h b/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.h index c4689ff3fab..c448b9ba4da 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.h +++ b/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.h @@ -19,6 +19,8 @@ enum CastTarget CAST_JUSTDIED_KILLER, //Only works within JustDied function }; +#define MAX_SIMPLEAI_SPELLS 10 + struct SimpleAI : public ScriptedAI { SimpleAI(Creature *c);// : ScriptedAI(c); @@ -61,10 +63,10 @@ public: //3 texts to many? int32 TextId[3]; uint32 Text_Sound[3]; - }Spell[10]; + }Spell[MAX_SIMPLEAI_SPELLS]; protected: - uint32 Spell_Timer[10]; + uint32 Spell_Timer[MAX_SIMPLEAI_SPELLS]; }; #endif -- cgit v1.2.3