From f4afde50e0f4dfc3df37653bd781a5a723b8d6e2 Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 18 Dec 2008 10:12:24 -0600 Subject: *Temp fix for the crash bug of uldaman script. This script is bugged and needs big fix. --HG-- branch : trunk --- .../scripts/zone/uldaman/boss_archaedas.cpp | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'src/bindings/scripts') 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; -- cgit v1.2.3