diff options
author | megamage <none@none> | 2008-12-18 10:12:24 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-12-18 10:12:24 -0600 |
commit | f4afde50e0f4dfc3df37653bd781a5a723b8d6e2 (patch) | |
tree | 9f0d75a4652c00c3f8a1a47d2fdd63c56ad60f0d /src | |
parent | d97133571a5b16cd320bc63b45b4715c8614ce27 (diff) |
*Temp fix for the crash bug of uldaman script. This script is bugged and needs big fix.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/scripts/zone/uldaman/boss_archaedas.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/bindings/scripts/scripts/zone/uldaman/boss_archaedas.cpp b/src/bindings/scripts/scripts/zone/uldaman/boss_archaedas.cpp index 2559212debc..69f4ceda8fb 100644 --- a/src/bindings/scripts/scripts/zone/uldaman/boss_archaedas.cpp +++ b/src/bindings/scripts/scripts/zone/uldaman/boss_archaedas.cpp @@ -418,22 +418,27 @@ EndScriptData */ static uint64 altarOfTheKeeperCount[5]; static uint32 altarOfTheKeeperCounter=0; - bool GOHello_go_altar_of_the_keepers(Player *player, GameObject* go) { + ScriptedInstance* pInstance = ((ScriptedInstance*)player->GetInstanceData()); + if (!pInstance) return true; + bool alreadyUsed; go->AddUse (); alreadyUsed = false; - for (uint32 loop=0; loop<5; loop++) { - if (altarOfTheKeeperCount[loop] == player->GetGUID()) alreadyUsed = true; + for (uint32 loop=0; loop<5; ++loop) + { + if (altarOfTheKeeperCount[loop] == player->GetGUID()) + alreadyUsed = true; } - if (!alreadyUsed) + if (!alreadyUsed && altarOfTheKeeperCounter < 5) altarOfTheKeeperCount[altarOfTheKeeperCounter++] = player->GetGUID(); player->CastSpell (player, SPELL_BOSS_OBJECT_VISUAL, false); - if (altarOfTheKeeperCounter < NUMBER_NEEDED_TO_ACTIVATE) { + if (altarOfTheKeeperCounter < NUMBER_NEEDED_TO_ACTIVATE) + { //error_log ("not enough people yet, altarOfTheKeeperCounter = %d", altarOfTheKeeperCounter); return false; // not enough people yet } @@ -441,7 +446,8 @@ bool GOHello_go_altar_of_the_keepers(Player *player, GameObject* go) // Check to make sure at least three people are still casting uint32 count=0; Unit *pTarget; - for (uint32 x=0; x<=5; x++) { + for (uint32 x = 0; x < 5; ++x) + { pTarget = Unit::GetUnit(*player, altarOfTheKeeperCount[x]); //error_log ("number of people currently activating it: %d", x+1); if (!pTarget) continue; @@ -449,13 +455,12 @@ bool GOHello_go_altar_of_the_keepers(Player *player, GameObject* go) if (count >= NUMBER_NEEDED_TO_ACTIVATE) break; } - if (count < NUMBER_NEEDED_TO_ACTIVATE) { + if (count < NUMBER_NEEDED_TO_ACTIVATE) + { // error_log ("still not enough people"); - return false; // not enough people + return true; // not enough people } - ScriptedInstance* pInstance = ((ScriptedInstance*)player->GetInstanceData()); - if (!pInstance) return false; //error_log ("activating stone keepers"); pInstance->SetData(NULL,1); // activate the Stone Keepers return true; |