Skip to content

Commit bbead02

Browse files
committed
[2521] Use previously added wrapper
1 parent 303e7d7 commit bbead02

10 files changed

Lines changed: 13 additions & 41 deletions

File tree

include/sc_instance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void ScriptedInstance::DoToggleGameObjectFlags(uint32 uiEntry, uint32 uiGOflags,
7272
{
7373
EntryGuidMap::iterator find = m_mGoEntryGuidStore.find(uiEntry);
7474
if (find != m_mGoEntryGuidStore.end())
75-
ToggleGameObjectFlags(find->second, uiGOflags, bApply);
75+
DoToggleGameObjectFlags(find->second, uiGOflags, bApply);
7676
else
7777
// Output log, possible reason is not added GO to storage, or not yet loaded
7878
debug_log("SD2: Script call ToogleTameObjectFlags (by Entry), but no gameobject of entry %u was created yet, or it was not stored by script for map %u.", uiEntry, instance->GetId());

scripts/eastern_kingdoms/blackwing_lair/instance_blackwing_lair.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ void instance_blackwing_lair::SetData(uint32 uiType, uint32 uiData)
109109
else if (uiData == FAIL)
110110
{
111111
// Reset the Orb of Domination and the eggs
112-
if (GameObject* pOrb = GetSingleGameObjectFromStorage(GO_ORB_OF_DOMINATION))
113-
pOrb->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NO_INTERACT);
112+
DoToggleGameObjectFlags(GO_ORB_OF_DOMINATION, GO_FLAG_NO_INTERACT, true);
114113

115114
// ToDo: reset the Dragon Eggs
116115
}
@@ -195,8 +194,7 @@ void instance_blackwing_lair::OnCreatureDeath(Creature* pCreature)
195194
{
196195
if (pCreature->GetEntry() == NPC_GRETHOK_CONTROLLER)
197196
{
198-
if (GameObject* pOrb = GetSingleGameObjectFromStorage(GO_ORB_OF_DOMINATION))
199-
pOrb->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NO_INTERACT);
197+
DoToggleGameObjectFlags(GO_ORB_OF_DOMINATION, GO_FLAG_NO_INTERACT, false);
200198

201199
if (Creature* pOrbTrigger = GetSingleCreatureFromStorage(NPC_BLACKWING_ORB_TRIGGER))
202200
pOrbTrigger->InterruptNonMeleeSpells(false);

scripts/eastern_kingdoms/karazhan/instance_karazhan.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ void instance_karazhan::SetData(uint32 uiType, uint32 uiData)
146146
{
147147
DoUseDoorOrButton(GO_STAGE_DOOR_LEFT);
148148
DoUseDoorOrButton(GO_STAGE_DOOR_RIGHT);
149-
if (GameObject* pSideEntrance = GetSingleGameObjectFromStorage(GO_SIDE_ENTRANCE_DOOR))
150-
pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED);
149+
DoToggleGameObjectFlags(GO_SIDE_ENTRANCE_DOOR, GO_FLAG_LOCKED, false);
151150
}
152151
break;
153152
case TYPE_CURATOR:

scripts/eastern_kingdoms/sunken_temple/instance_sunken_temple.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -304,16 +304,7 @@ bool instance_sunken_temple::ProcessStatueEvent(uint32 uiEventId)
304304
void instance_sunken_temple::DoUpdateFlamesFlags(bool bRestore)
305305
{
306306
for (GUIDList::const_iterator itr = m_luiFlameGUIDs.begin(); itr != m_luiFlameGUIDs.end(); ++itr)
307-
{
308-
if (GameObject* pFlame = instance->GetGameObject(*itr))
309-
{
310-
// Remove the flags of the flames for Hakkar event
311-
if (!bRestore)
312-
pFlame->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NO_INTERACT);
313-
else
314-
pFlame->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NO_INTERACT);
315-
}
316-
}
307+
DoToggleGameObjectFlags(*itr, GO_FLAG_NO_INTERACT, bRestore);
317308
}
318309

319310
void instance_sunken_temple::Load(const char* chrIn)

scripts/eastern_kingdoms/zulaman/zulaman.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ struct MANGOS_DLL_DECL npc_harrison_jones_zaAI : public npc_escortAI
143143
case 1:
144144
DoScriptText(SAY_AT_GONG, m_creature);
145145

146-
if (GameObject* pStrangeGong = m_pInstance->GetSingleGameObjectFromStorage(GO_STRANGE_GONG))
147-
pStrangeGong->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NO_INTERACT);
146+
m_pInstance->DoToggleGameObjectFlags(GO_STRANGE_GONG, GO_FLAG_NO_INTERACT, false);
148147

149148
//Start bang gong for 2min
150149
m_creature->CastSpell(m_creature, SPELL_BANGING_THE_GONG, false);

scripts/northrend/nexus/nexus/instance_nexus.cpp

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,28 +101,19 @@ void instance_nexus::SetData(uint32 uiType, uint32 uiData)
101101
if (uiData == IN_PROGRESS)
102102
SetSpecialAchievementCriteria(TYPE_ACHIEV_SPLIT_PERSONALITY, true);
103103
if (uiData == DONE)
104-
{
105-
if (GameObject* pGo = GetSingleGameObjectFromStorage(GO_CONTAINMENT_SPHERE_TELESTRA))
106-
pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NO_INTERACT);
107-
}
104+
DoToggleGameObjectFlags(GO_CONTAINMENT_SPHERE_TELESTRA, GO_FLAG_NO_INTERACT, false);
108105
break;
109106
case TYPE_ANOMALUS:
110107
m_auiEncounter[uiType] = uiData;
111108
if (uiData == IN_PROGRESS)
112109
SetSpecialAchievementCriteria(TYPE_ACHIEV_CHAOS_THEORY, true);
113110
if (uiData == DONE)
114-
{
115-
if (GameObject* pGo = GetSingleGameObjectFromStorage(GO_CONTAINMENT_SPHERE_ANOMALUS))
116-
pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NO_INTERACT);
117-
}
111+
DoToggleGameObjectFlags(GO_CONTAINMENT_SPHERE_ANOMALUS, GO_FLAG_NO_INTERACT, false);
118112
break;
119113
case TYPE_ORMOROK:
120114
m_auiEncounter[uiType] = uiData;
121115
if (uiData == DONE)
122-
{
123-
if (GameObject* pGo = GetSingleGameObjectFromStorage(GO_CONTAINMENT_SPHERE_ORMOROK))
124-
pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NO_INTERACT);
125-
}
116+
DoToggleGameObjectFlags(GO_CONTAINMENT_SPHERE_ORMOROK, GO_FLAG_NO_INTERACT, false);
126117
break;
127118
case TYPE_KERISTRASZA:
128119
m_auiEncounter[uiType] = uiData;

scripts/northrend/nexus/oculus/instance_oculus.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,7 @@ void instance_oculus::SetData(uint32 uiType, uint32 uiData)
7373
case TYPE_EREGOS:
7474
m_auiEncounter[TYPE_EREGOS] = uiData;
7575
if (uiData == DONE)
76-
{
77-
if (GameObject* pChest = GetSingleGameObjectFromStorage(instance->IsRegularDifficulty() ? GO_CACHE_EREGOS : GO_CACHE_EREGOS_H))
78-
pChest->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NO_INTERACT);
79-
}
76+
DoToggleGameObjectFlags(instance->IsRegularDifficulty() ? GO_CACHE_EREGOS : GO_CACHE_EREGOS_H, GO_FLAG_NO_INTERACT, false);
8077
break;
8178
}
8279

scripts/northrend/ulduar/halls_of_stone/instance_halls_of_stone.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ void instance_halls_of_stone::SetData(uint32 uiType, uint32 uiData)
113113
SortFaces();
114114
break;
115115
case DONE:
116-
if (GameObject* pChest = GetSingleGameObjectFromStorage(instance->IsRegularDifficulty() ? GO_TRIBUNAL_CHEST : GO_TRIBUNAL_CHEST_H))
117-
pChest->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NO_INTERACT);
116+
DoToggleGameObjectFlags(instance->IsRegularDifficulty() ? GO_TRIBUNAL_CHEST : GO_TRIBUNAL_CHEST_H, GO_FLAG_NO_INTERACT, false);
118117
// Door workaround because of the missing Bran event
119118
DoUseDoorOrButton(GO_DOOR_SJONNIR);
120119
break;

scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ void instance_sethekk_halls::SetData(uint32 uiType, uint32 uiData)
6565
if (uiData == DONE)
6666
{
6767
DoUseDoorOrButton(GO_IKISS_DOOR, DAY);
68-
69-
if(GameObject* pChest = GetSingleGameObjectFromStorage(GO_IKISS_CHEST))
70-
pChest->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NO_INTERACT | GO_FLAG_INTERACT_COND);
68+
DoToggleGameObjectFlags(GO_IKISS_CHEST, GO_FLAG_NO_INTERACT | GO_FLAG_INTERACT_COND, false);
7169
}
7270
m_auiEncounter[uiType] = uiData;
7371
break;

sd2_revision_nr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#ifndef __SD2_REVISION_NR_H__
22
#define __SD2_REVISION_NR_H__
3-
#define SD2_REVISION_NR "2520"
3+
#define SD2_REVISION_NR "2521"
44
#endif // __SD2_REVISION_NR_H__

0 commit comments

Comments
 (0)