diff options
author | joschiwald <joschiwald.trinity@gmail.com> | 2014-09-07 21:03:25 +0200 |
---|---|---|
committer | joschiwald <joschiwald.trinity@gmail.com> | 2014-09-07 21:03:25 +0200 |
commit | cfc0c50b5e3bc84310417c5146ce0d5901e39fc5 (patch) | |
tree | d4f98ee08cc7fe798847a8e6438c0605c6ec1a10 | |
parent | df7f188cfe1b407520549f7374bfd070d83140e5 (diff) |
Core/Misc: dropped obsolete GameObject::GetGameObject method
12 files changed, 83 insertions, 101 deletions
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 3c33159cf1e..f45d3a071e1 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -892,11 +892,6 @@ void GameObject::DeleteFromDB() WorldDatabase.Execute(stmt); } -GameObject* GameObject::GetGameObject(WorldObject& object, uint64 guid) -{ - return object.GetMap()->GetGameObject(guid); -} - /*********************************************************/ /*** QUEST SYSTEM ***/ /*********************************************************/ diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index f551ab2046c..6807fbf9387 100644 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -643,7 +643,6 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map bool Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state, uint32 artKit = 0); void Update(uint32 p_time) override; - static GameObject* GetGameObject(WorldObject& object, uint64 guid); GameObjectTemplate const* GetGOInfo() const { return m_goInfo; } GameObjectData const* GetGOData() const { return m_goData; } GameObjectValue const* GetGOValue() const { return &m_goValue; } diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp index b0222413513..7338620a8b2 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp @@ -133,7 +133,7 @@ public: ++uiHealth; DoCastAOE(SPELL_SMITE_STOMP, false); SetCombatMovement(false); - if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_SMITE_CHEST))) + if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_SMITE_CHEST))) { me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MovePoint(1, go->GetPositionX() - 3.0f, go->GetPositionY(), go->GetPositionZ()); diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp index 220cf0c92b4..d009986651a 100644 --- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp @@ -142,56 +142,48 @@ public: uiPhase = uiPhaseStep; } - void CaveDestruction(bool bBool) + void CaveDestruction(bool isRight) { if (GoSummonList.empty()) return; for (std::list<uint64>::const_iterator itr = GoSummonList.begin(); itr != GoSummonList.end(); ++itr) { - if (GameObject* go = GameObject::GetGameObject(*me, *itr)) - { - if (go) + if (GameObject* go = ObjectAccessor::GetGameObject(*me, *itr)) + { + if (Creature* trigger = go->SummonTrigger(go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0, 1)) { - if (Creature* trigger = go->SummonTrigger(go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0, 1)) - { - //visual effects are not working! - trigger->CastSpell(trigger, 11542, true); - trigger->CastSpell(trigger, 35470, true); - } - go->RemoveFromWorld(); - //go->CastSpell(me, 12158); makes all die?! + //visual effects are not working! + trigger->CastSpell(trigger, 11542, true); + trigger->CastSpell(trigger, 35470, true); } - } + go->RemoveFromWorld(); + //go->CastSpell(me, 12158); makes all die?! + } } - if (bBool) - { - if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) - instance->HandleGameObject(0, false, go); - }else - if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT))) - instance->HandleGameObject(0, false, go); + if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetData64(isRight ? DATA_GO_CAVE_IN_RIGHT : DATA_GO_CAVE_IN_LEFT))) + instance->HandleGameObject(0, false, go); } void SetInFace(bool isRight) { - if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(isRight ? DATA_GO_CAVE_IN_RIGHT : DATA_GO_CAVE_IN_LEFT))) + if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetData64(isRight ? DATA_GO_CAVE_IN_RIGHT : DATA_GO_CAVE_IN_LEFT))) me->SetFacingToObject(go); } void RestoreAll() { - if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) + if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) instance->HandleGameObject(0, false, go); - if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT))) + if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT))) instance->HandleGameObject(0, false, go); if (!GoSummonList.empty()) for (std::list<uint64>::const_iterator itr = GoSummonList.begin(); itr != GoSummonList.end(); ++itr) { - if (GameObject* go = GameObject::GetGameObject(*me, *itr)) + if (GameObject* go = ObjectAccessor::GetGameObject(*me, *itr)) go->RemoveFromWorld(); } @@ -406,7 +398,7 @@ public: SetInFace(true); Talk(SAY_BLASTMASTER_5); Summon(1); - if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) + if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) instance->HandleGameObject(0, true, go); NextStep(3000, true); break; @@ -452,7 +444,7 @@ public: case 16: Talk(SAY_BLASTMASTER_14); SetInFace(false); - if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT))) + if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT))) instance->HandleGameObject(0, true, go); NextStep(2000, true); break; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp index 9a1f8f14557..0386341ed0c 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp @@ -162,52 +162,58 @@ class spell_shadow_portal : public SpellScriptLoader { PrepareSpellScript(spell_shadow_portal_SpellScript); + bool Load() override + { + _instance = GetCaster()->GetInstanceScript(); + return _instance != nullptr; + } + void HandleCast(SpellEffIndex /*effIndex*/) { - Creature* caster = GetCaster()->ToCreature(); - int8 attempts = 0; - int32 spell_to_cast =0; + Unit* caster = GetCaster(); + uint8 attempts = 0; + uint32 spellId = 0; - while (!spell_to_cast) + while (!spellId) { if (attempts++ >= 6) break; switch (urand(0, 5)) { case ROOM_HALL_OF_SECRETS: - if (InstanceScript* instance = GetCaster()->GetInstanceScript()) - if (GameObject::GetGameObject(*caster, instance->GetData64(GO_GATE_RAVENIAN))->GetGoState() == GO_STATE_ACTIVE) - spell_to_cast = SPELL_SHADOW_PORTAL_HALLOFSECRETS; + if (GameObject* go = ObjectAccessor::GetGameObject(*caster, _instance->GetData64(GO_GATE_RAVENIAN))) + if (go->GetGoState() == GO_STATE_ACTIVE) + spellId = SPELL_SHADOW_PORTAL_HALLOFSECRETS; break; case ROOM_HALL_OF_THE_DAMNED: - if (InstanceScript* instance = GetCaster()->GetInstanceScript()) - if (GameObject::GetGameObject(*caster, instance->GetData64(GO_GATE_THEOLEN))->GetGoState() == GO_STATE_ACTIVE) - spell_to_cast = SPELL_SHADOW_PORTAL_HALLOFTHEDAMNED; + if (GameObject* go = ObjectAccessor::GetGameObject(*caster, _instance->GetData64(GO_GATE_THEOLEN))) + if (go->GetGoState() == GO_STATE_ACTIVE) + spellId = SPELL_SHADOW_PORTAL_HALLOFTHEDAMNED; break; case ROOM_THE_COVEN: - if (InstanceScript* instance = GetCaster()->GetInstanceScript()) - if (GameObject::GetGameObject(*caster, instance->GetData64(GO_GATE_MALICIA))->GetGoState() == GO_STATE_ACTIVE) - spell_to_cast = SPELL_SHADOW_PORTAL_THECOVEN; + if (GameObject* go = ObjectAccessor::GetGameObject(*caster, _instance->GetData64(GO_GATE_MALICIA))) + if (go->GetGoState() == GO_STATE_ACTIVE) + spellId = SPELL_SHADOW_PORTAL_THECOVEN; break; case ROOM_THE_SHADOW_VAULT: - if (InstanceScript* instance = GetCaster()->GetInstanceScript()) - if (GameObject::GetGameObject(*caster, instance->GetData64(GO_GATE_ILLUCIA))->GetGoState() == GO_STATE_ACTIVE) - spell_to_cast = SPELL_SHADOW_PORTAL_THESHADOWVAULT; + if (GameObject* go = ObjectAccessor::GetGameObject(*caster, _instance->GetData64(GO_GATE_ILLUCIA))) + if (go->GetGoState() == GO_STATE_ACTIVE) + spellId = SPELL_SHADOW_PORTAL_THESHADOWVAULT; break; case ROOM_BAROV_FAMILY_VAULT: - if (InstanceScript* instance = GetCaster()->GetInstanceScript()) - if (GameObject::GetGameObject(*caster, instance->GetData64(GO_GATE_BAROV))->GetGoState() == GO_STATE_ACTIVE) - spell_to_cast = SPELL_SHADOW_PORTAL_BAROVFAMILYVAULT; + if (GameObject* go = ObjectAccessor::GetGameObject(*caster, _instance->GetData64(GO_GATE_BAROV))) + if (go->GetGoState() == GO_STATE_ACTIVE) + spellId = SPELL_SHADOW_PORTAL_BAROVFAMILYVAULT; break; case ROOM_VAULT_OF_THE_RAVENIAN: - if (InstanceScript* instance = GetCaster()->GetInstanceScript()) - if (GameObject::GetGameObject(*caster, instance->GetData64(GO_GATE_POLKELT))->GetGoState() == GO_STATE_ACTIVE) - spell_to_cast = SPELL_SHADOW_PORTAL_VAULTOFTHERAVENIAN; + if (GameObject* go = ObjectAccessor::GetGameObject(*caster, _instance->GetData64(GO_GATE_POLKELT))) + if (go->GetGoState() == GO_STATE_ACTIVE) + spellId = SPELL_SHADOW_PORTAL_VAULTOFTHERAVENIAN; break; } - if (spell_to_cast) - GetHitUnit()->CastSpell(GetHitUnit(), spell_to_cast); + if (spellId) + GetHitUnit()->CastSpell(GetHitUnit(), spellId); } } @@ -215,6 +221,9 @@ class spell_shadow_portal : public SpellScriptLoader { OnEffectHitTarget += SpellEffectFn(spell_shadow_portal_SpellScript::HandleCast, EFFECT_0, SPELL_EFFECT_DUMMY); } + + private: + InstanceScript* _instance; }; SpellScript* GetSpellScript() const override @@ -276,12 +285,17 @@ class spell_shadow_portal_rooms : public SpellScriptLoader { PrepareSpellScript(spell_shadow_portal_rooms_SpellScript); + bool Load() override + { + _instance = GetCaster()->GetInstanceScript(); + return _instance != nullptr; + } + void HandleSendEvent(SpellEffIndex effIndex) { // If only one player in threat list fail spell - Creature* Summoned = NULL; - Creature* caster = GetCaster()->ToCreature(); + Unit* caster = GetCaster(); int8 pos_to_summon = 0; int8 phase_to_set = 0; @@ -323,21 +337,19 @@ class spell_shadow_portal_rooms : public SpellScriptLoader break; } - if (gate_to_close && (GetCaster()->GetMap()->GetId() == 289)) + if (gate_to_close && (caster->GetMap()->GetId() == 289)) { for (uint8 i = 0; i < 3; ++i) { - Summoned = GetCaster()->SummonCreature(NPC_RISEN_GUARDIAN, SummonPos[pos_to_summon++], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - if (Summoned) + if (Creature* Summoned = caster->SummonCreature(NPC_RISEN_GUARDIAN, SummonPos[pos_to_summon++], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) { Summoned->GetMotionMaster()->MoveRandom(5); Summoned->AI()->SetData(0, phase_to_set); } } - if (InstanceScript* instance = GetCaster()->GetInstanceScript()) - if (GameObject* gate = GameObject::GetGameObject(*caster, instance->GetData64(gate_to_close))) - gate->SetGoState(GO_STATE_READY); + if (GameObject* gate = ObjectAccessor::GetGameObject(*caster, _instance->GetData64(gate_to_close))) + gate->SetGoState(GO_STATE_READY); } } @@ -345,6 +357,9 @@ class spell_shadow_portal_rooms : public SpellScriptLoader { OnEffectHit += SpellEffectFn(spell_shadow_portal_rooms_SpellScript::HandleSendEvent, EFFECT_1, SPELL_EFFECT_SEND_EVENT); } + + private: + InstanceScript* _instance; }; SpellScript* GetSpellScript() const override diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp index e073d08ef1d..f601f06e16c 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp @@ -138,7 +138,7 @@ public: break; case DATA_IN_POSITION: //movement done. me->GetMotionMaster()->MovePoint(1, 735.81f, 661.92f, 412.39f); - if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_MAIN_GATE))) + if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_MAIN_GATE))) instance->HandleGameObject(go->GetGUID(), false); NextStep(10000, false, 3); break; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp index 3b919a778b3..949ee652d81 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp @@ -96,11 +96,10 @@ class instance_trial_of_the_crusader : public InstanceMapScript // make sure Anub'arak isnt missing and floor is destroyed after a crash if (GetBossState(BOSS_LICH_KING) == DONE && TrialCounter && GetBossState(BOSS_ANUBARAK) != DONE) { - Creature* anubArak = ObjectAccessor::GetCreature(*player, GetData64(NPC_ANUBARAK)); - if (!anubArak) + if (Creature* anubArak = ObjectAccessor::GetCreature(*player, GetData64(NPC_ANUBARAK))) anubArak = player->SummonCreature(NPC_ANUBARAK, AnubarakLoc[0].GetPositionX(), AnubarakLoc[0].GetPositionY(), AnubarakLoc[0].GetPositionZ(), 3, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME); - if (GameObject* floor = GameObject::GetGameObject(*player, GetData64(GO_ARGENT_COLISEUM_FLOOR))) + if (GameObject* floor = ObjectAccessor::GetGameObject(*player, GetData64(GO_ARGENT_COLISEUM_FLOOR))) floor->SetDestructibleState(GO_DESTRUCTIBLE_DAMAGED); } } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp index 7829d1be627..b068b458073 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp @@ -201,7 +201,7 @@ class npc_announcer_toc10 : public CreatureScript } else if (instance->GetBossState(BOSS_LICH_KING) != DONE) { - if (GameObject* floor = GameObject::GetGameObject(*player, instance->GetData64(GO_ARGENT_COLISEUM_FLOOR))) + if (GameObject* floor = ObjectAccessor::GetGameObject(*player, instance->GetData64(GO_ARGENT_COLISEUM_FLOOR))) floor->SetDestructibleState(GO_DESTRUCTIBLE_DAMAGED); creature->CastSpell(creature, SPELL_CORPSE_TELEPORT, false); @@ -318,7 +318,7 @@ class boss_lich_king_toc : public CreatureScript break; case 5080: { - if (GameObject* go = GameObject::GetGameObject(*me, _instance->GetData64(GO_ARGENT_COLISEUM_FLOOR))) + if (GameObject* go = ObjectAccessor::GetGameObject(*me, _instance->GetData64(GO_ARGENT_COLISEUM_FLOOR))) { go->SetDisplayId(DISPLAYID_DESTROYED_FLOOR); go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED | GO_FLAG_NODESPAWN); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 4b9308fc12d..2909946a0db 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -305,12 +305,6 @@ class boss_deathbringer_saurfang : public CreatureScript _introDone = true; - if (GameObject* teleporter = GameObject::GetGameObject(*me, instance->GetData64(GO_SCOURGE_TRANSPORTER_DEATHBRINGER))) - { - instance->HandleGameObject(0, false, teleporter); - teleporter->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); - } - Talk(SAY_AGGRO); events.ScheduleEvent(EVENT_SUMMON_BLOOD_BEAST, 30000, 0, PHASE_COMBAT); events.ScheduleEvent(EVENT_BERSERK, IsHeroic() ? 360000 : 480000, 0, PHASE_COMBAT); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index e403e37835c..23569ba77c2 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -2120,15 +2120,8 @@ class at_icc_shutdown_traps : public AreaTriggerScript bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/) override { if (InstanceScript* instance = player->GetInstanceScript()) - { instance->SetData(DATA_UPPERSPIRE_TELE_ACT, DONE); - uint64 teleporterGUID = instance->GetData64(GO_SCOURGE_TRANSPORTER_UPPERSPIRE); - if (GameObject* go = instance->instance->GetGameObject(teleporterGUID)) - { - go->SetGoState(GO_STATE_ACTIVE); - go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); - } - } + return true; } }; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index f5f59e5d1fe..3f429183fa0 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -773,20 +773,6 @@ class instance_icecrown_citadel : public InstanceMapScript return DeathbringerSaurfangEventGUID; case GO_SAURFANG_S_DOOR: return DeathbringerSaurfangDoorGUID; - case GO_SCOURGE_TRANSPORTER_LICHKING: - return TeleporterLichKingGUID; - case GO_SCOURGE_TRANSPORTER_UPPERSPIRE: - return TeleporterUpperSpireGUID; - case GO_SCOURGE_TRANSPORTER_LIGHTSHAMMER: - return TeleporterLightsHammerGUID; - case GO_SCOURGE_TRANSPORTER_RAMPART: - return TeleporterRampartsGUID; - case GO_SCOURGE_TRANSPORTER_DEATHBRINGER: - return TeleporterDeathBringerGUID; - case GO_SCOURGE_TRANSPORTER_ORATORY: - return TeleporterOratoryGUID; - case GO_SCOURGE_TRANSPORTER_SINDRAGOSA: - return TeleporterSindragosaGUID; case DATA_FESTERGUT: return FestergutGUID; case DATA_ROTFACE: @@ -911,7 +897,12 @@ class instance_icecrown_citadel : public InstanceMapScript { if (GameObject* teleporter = instance->GetGameObject(TeleporterDeathBringerGUID)) SetTeleporterState(teleporter, true); - + break; + } + case IN_PROGRESS: + { + if (GameObject* teleporter = instance->GetGameObject(TeleporterDeathBringerGUID)) + SetTeleporterState(teleporter, false); break; } default: @@ -1126,7 +1117,11 @@ class instance_icecrown_citadel : public InstanceMapScript case DATA_UPPERSPIRE_TELE_ACT: UpperSpireTeleporterActiveState = data; if (UpperSpireTeleporterActiveState == DONE) + { + if (GameObject* go = instance->GetGameObject(TeleporterUpperSpireGUID)) + SetTeleporterState(go, true); SaveToDB(); + } break; default: break; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp index ea345c0dee0..0f5320a8fa1 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp @@ -375,7 +375,7 @@ class boss_sapphiron : public CreatureScript for (IceBlockMap::const_iterator itr = _iceblocks.begin(); itr != _iceblocks.end(); ++itr) { - if (GameObject* go = GameObject::GetGameObject(*me, itr->second)) + if (GameObject* go = ObjectAccessor::GetGameObject(*me, itr->second)) { if (go->IsInBetween(me, target, 2.0f) && me->GetExactDist2d(target->GetPositionX(), target->GetPositionY()) - me->GetExactDist2d(go->GetPositionX(), go->GetPositionY()) < 5.0f) |