Core/AI: Making guid const& in SetGUID method

This commit is contained in:
Aokromes committed 2018-01-01 14:55:20 +01:00
1 parent 0fdf3571a1
commit f2ab43568a
35 files changed
+54 -54

No files matched your search

@@ -287,9 +287,9 @@ public:
{
npc_coren_direbrew_sistersAI(Creature* creature) : ScriptedAI(creature) { }
void SetGUID(ObjectGuid guid, int32 data) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
if (data == DATA_TARGET_GUID)
if (id == DATA_TARGET_GUID)
_targetGUID = guid;
}
@@ -207,9 +207,9 @@ public:
BossAI::JustDied(killer);
}
void SetGUID(ObjectGuid guid, int32 data) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
if (data == NPC_MIDNIGHT)
if (id == NPC_MIDNIGHT)
_midnightGUID = guid;
}
@@ -305,7 +305,7 @@ public:
ObjectGuid prisonerGUID;
void SetGUID(ObjectGuid guid, int32 /*id*/) override
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
{
if (!prisonerGUID)
prisonerGUID = guid;
@@ -1169,7 +1169,7 @@ class npc_scarlet_miner : public CreatureScript
}
}
void SetGUID(ObjectGuid guid, int32 /*id = 0*/) override
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
{
InitWaypoint();
Start(false, false, guid);
@@ -213,7 +213,7 @@ class boss_mandokir : public CreatureScript
return 0;
}
void SetGUID(ObjectGuid guid, int32 /*type = 0 */) override
void SetGUID(ObjectGuid const& guid, int32 /*id = 0 **/) override
{
_reviveGUID = guid;
}
@@ -369,7 +369,7 @@ class npc_chained_spirit : public CreatureScript
_revivePlayerGUID.Clear();
}
void SetGUID(ObjectGuid guid, int32 /*type = 0 */) override
void SetGUID(ObjectGuid const& guid, int32 /*id = 0 */) override
{
_revivePlayerGUID = guid;
}
@@ -137,9 +137,9 @@ public:
_events.ScheduleEvent(EVENT_MULTI_SHOT, 10000);
}
void SetGUID(ObjectGuid guid, int32 type) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
if (type == GUID_EVENT_INVOKER)
if (id == GUID_EVENT_INVOKER)
{
Talk(EMOTE_LAMENT);
DoPlaySoundToSet(me, SOUND_CREDIT);
@@ -285,9 +285,9 @@ class boss_baleroc : public CreatureScript
DoBalerocAttackIfReady();
}
void SetGUID(ObjectGuid guid, int32 type = 0) override
void SetGUID(ObjectGuid const& guid, int32 id = 0) override
{
switch (type)
switch (id)
{
case GUID_TORMENTED:
{
@@ -304,7 +304,7 @@ class npc_prince_taldaram_flame_sphere : public CreatureScript
_events.ScheduleEvent(EVENT_DESPAWN, 13 * IN_MILLISECONDS);
}
void SetGUID(ObjectGuid guid, int32 /*id = 0*/) override
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
{
_flameSphereTargetGUID = guid;
}
@@ -294,9 +294,9 @@ public:
Talk(SAY_SLAY);
}
void SetGUID(ObjectGuid guid, int32 type) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
switch (type)
switch (id)
{
case GUID_TYPE_PET:
{
@@ -269,7 +269,7 @@ public:
nerubian->DespawnOrUnsummon();
}
void SetGUID(ObjectGuid guid, int32 /*what*/) override
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
{
_anubar.push_back(guid);
}
@@ -1141,7 +1141,7 @@ class npc_meteor_strike_flame : public CreatureScript
SetCombatMovement(false);
}
void SetGUID(ObjectGuid guid, int32 /*id = 0 */) override
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
{
_rootOwnerGuid = guid;
_events.ScheduleEvent(EVENT_SPAWN_METEOR_FLAME, Milliseconds(800));
@@ -357,7 +357,7 @@ class npc_snobold_vassal : public CreatureScript
}
}
void SetGUID(ObjectGuid guid, int32 id) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
if (id == DATA_NEW_TARGET)
if (Unit* target = ObjectAccessor::GetPlayer(*me, guid))
@@ -334,9 +334,9 @@ class boss_rimefang : public CreatureScript
_EnterEvadeMode();
}
void SetGUID(ObjectGuid guid, int32 type) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
if (type == GUID_HOARFROST)
if (id == GUID_HOARFROST)
{
_hoarfrostTargetGUID = guid;
_events.ScheduleEvent(EVENT_HOARFROST, 1000);
@@ -137,9 +137,9 @@ class boss_gal_darah : public CreatureScript
}
}
void SetGUID(ObjectGuid guid, int32 type /*= 0*/) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
if (type == DATA_SHARE_THE_LOVE)
if (id == DATA_SHARE_THE_LOVE)
{
if (Unit* target = ObjectAccessor::GetUnit(*me, guid))
Talk(EMOTE_IMPALE, target);
@@ -184,9 +184,9 @@ public:
summons.Summon(summon);
}
void SetGUID(ObjectGuid guid, int32 type) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
if (type == DATA_SNAKES_WHYD_IT_HAVE_TO_BE_SNAKES)
if (id == DATA_SNAKES_WHYD_IT_HAVE_TO_BE_SNAKES)
lWrappedPlayers.insert(guid);
}
@@ -985,7 +985,7 @@ class npc_ball_of_flame : public CreatureScript
}
}
void SetGUID(ObjectGuid guid, int32 /*type*/) override
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
{
_chaseGUID = guid;
}
@@ -281,9 +281,9 @@ class boss_blood_queen_lana_thel : public CreatureScript
Talk(SAY_KILL);
}
void SetGUID(ObjectGuid guid, int32 type = 0) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
switch (type)
switch (id)
{
case GUID_VAMPIRE:
_vampires.insert(guid);
@@ -799,7 +799,7 @@ class npc_gunship : public CreatureScript
}
}
void SetGUID(ObjectGuid guid, int32 id/* = 0*/) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
if (id != ACTION_SHIP_VISITS)
return;
@@ -813,7 +813,7 @@ class npc_vengeful_shade : public CreatureScript
});
}
void SetGUID(ObjectGuid guid, int32 /*type*/) override
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
{
_targetGUID = guid;
}
@@ -305,9 +305,9 @@ class boss_lord_marrowgar : public CreatureScript
return ObjectGuid::Empty;
}
void SetGUID(ObjectGuid guid, int32 type /*= 0 */) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
switch (type)
switch (id)
{
case DATA_COLDFLAME_GUID:
_coldflameTarget = guid;
@@ -582,9 +582,9 @@ class npc_ice_tomb : public CreatureScript
me->SetReactState(REACT_PASSIVE);
}
void SetGUID(ObjectGuid guid, int32 type/* = 0 */) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
if (type == DATA_TRAPPED_PLAYER)
if (id == DATA_TRAPPED_PLAYER)
{
_trappedPlayerGUID = guid;
_existenceCheckTimer = 1000;
@@ -1547,7 +1547,7 @@ class npc_valkyr_shadowguard : public CreatureScript
}
}
void SetGUID(ObjectGuid guid, int32 /* = 0*/) override
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
{
_grabbedPlayer = guid;
}
@@ -1015,9 +1015,9 @@ class npc_crok_scourgebane : public CreatureScript
}
}
void SetGUID(ObjectGuid guid, int32 type/* = 0*/) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
if (type == ACTION_VRYKUL_DEATH)
if (id == ACTION_VRYKUL_DEATH)
{
_aliveTrash.erase(guid);
if (_aliveTrash.empty())
@@ -209,7 +209,7 @@ public:
me->SetVisible(false);
}
void SetGUID(ObjectGuid guid, int32 /*param*/) override
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
{
if (!guid)
return;
@@ -436,9 +436,9 @@ struct npc_sapphiron_blizzard : public ScriptedAI
return data == DATA_BLIZZARD_TARGET ? _targetGuid : ObjectGuid::Empty;
}
void SetGUID(ObjectGuid guid, int32 data) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
if (data == DATA_BLIZZARD_TARGET)
if (id == DATA_BLIZZARD_TARGET)
_targetGuid = guid;
}
@@ -430,9 +430,9 @@ public:
return ObjectGuid::Empty;
}
void SetGUID(ObjectGuid guid, int32 type) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
switch (type)
switch (id)
{
case DATA_LAST_OVERLOAD_GUID:
_arcaneOverloadGUID = guid;
@@ -440,7 +440,7 @@ public:
case DATA_FIRST_SURGE_TARGET_GUID:
case DATA_FIRST_SURGE_TARGET_GUID + 1:
case DATA_FIRST_SURGE_TARGET_GUID + 2:
_surgeTargetGUID[type - DATA_FIRST_SURGE_TARGET_GUID] = guid;
_surgeTargetGUID[id - DATA_FIRST_SURGE_TARGET_GUID] = guid;
break;
case DATA_LAST_TARGET_BARRAGE_GUID:
_lastHitByArcaneBarrageGUID = guid;
@@ -148,7 +148,7 @@ class boss_keristrasza : public CreatureScript
}
}
void SetGUID(ObjectGuid guid, int32 id/* = 0 */) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
if (id == DATA_INTENSE_COLD)
_intenseColdList.push_back(guid);
@@ -500,9 +500,9 @@ class boss_thorim : public CreatureScript
_DespawnAtEvade();
}
void SetGUID(ObjectGuid guid, int32 type) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
if (type == DATA_CHARGED_PILLAR)
if (id == DATA_CHARGED_PILLAR)
{
_activePillarGUID = guid;
@@ -2219,7 +2219,7 @@ public:
uiEventPhase = 1;
}
void SetGUID(ObjectGuid uiGuid, int32 /*iId*/ = 0) override
void SetGUID(ObjectGuid const& uiGuid, int32 /*iId*/ = 0) override
{
uiPlayerGUID = uiGuid;
}
@@ -2435,7 +2435,7 @@ public:
_playerGUID.Clear();
}
void SetGUID(ObjectGuid guid, int32 /*action*/) override
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
{
if (!_playerGUID.IsEmpty())
return;
@@ -1633,7 +1633,7 @@ public:
});
}
void SetGUID(ObjectGuid guid, int32 /*id*/) override
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
{
_targetGUID = guid;
if (Unit* target = ObjectAccessor::GetUnit(*me, _targetGUID))
@@ -102,7 +102,7 @@ public:
Initialize();
}
void SetGUID(ObjectGuid guid, int32 id/* = 0 */) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
if (id == INNER_DEMON_VICTIM)
victimGUID = guid;
@@ -555,7 +555,7 @@ class npc_simon_bunny : public CreatureScript
}
// Used for getting involved player guid. Parameter id is used for defining if is a large(Monument) or small(Relic) node
void SetGUID(ObjectGuid guid, int32 id) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
me->SetCanFly(true);