refactor(Core): Make ObjectGuid const (#23170)

* cherry-pick commit (a7883380ce)

Co-Authored-By: Lucas Nascimento <keader.android@gmail.com>
This commit is contained in:
天鹭
2025-10-13 10:13:12 +08:00
committed by GitHub
parent 9c49349e1e
commit 8e2e30328f
51 changed files with 119 additions and 119 deletions

View File

@@ -118,7 +118,7 @@ public:
return !victim->HasAura(SPELL_TIMELAPSE);
}
void SetGUID(ObjectGuid guid, int32 id) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
if (id == GUID_LEVER_USER)
{

View File

@@ -152,7 +152,7 @@ public:
}
}
void SetGUID(ObjectGuid const guid, int32 /*id*/) override
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
{
_charmerGUID = guid;
}

View File

@@ -183,7 +183,7 @@ public:
}
}
void SetGUID(ObjectGuid guid, int32 index) override
void SetGUID(ObjectGuid const& guid, int32 index) override
{
if (index == GO_LAVA_BURST)
{

View File

@@ -131,7 +131,7 @@ public:
uint32 checkTimer;
ObjectGuid playerGUID;
void SetGUID(ObjectGuid guid, int32) override
void SetGUID(ObjectGuid const& guid, int32) override
{
playerGUID = guid;
}

View File

@@ -151,7 +151,7 @@ struct boss_shade_of_aran : public BossAI
return me->GetDistance2d(roomCenter.GetPositionX(), roomCenter.GetPositionY()) < 45.0f;
}
void SetGUID(ObjectGuid guid, int32 id) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
if (id == ACTION_ATIESH_REACT && !_atieshReaction)
{

View File

@@ -396,7 +396,7 @@ public:
AttackStart(attacker);
}
void SetGUID(ObjectGuid guid, int32) override
void SetGUID(ObjectGuid const& guid, int32) override
{
gothikGUID = guid;
events.ScheduleEvent(EVENT_GHOUL_MOVE_TO_PIT, 3s);
@@ -806,7 +806,7 @@ public:
ObjectGuid prisonerGUID;
void SetGUID(ObjectGuid guid, int32 /*id*/) override
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
{
if (!prisonerGUID)
prisonerGUID = guid;
@@ -866,7 +866,7 @@ public:
ObjectGuid minerGUID;
void SetGUID(ObjectGuid guid, int32 /*id*/) override
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
{
minerGUID = guid;
}

View File

@@ -250,7 +250,7 @@ public:
}
}
void SetGUID(ObjectGuid const guid, int32 type) override
void SetGUID(ObjectGuid const& guid, int32 type) override
{
if (type == ACTION_CHARGE)
{
@@ -564,7 +564,7 @@ public:
RevivePlayer(victim, reviveGUID);
}
void SetGUID(ObjectGuid const guid, int32 /*type = 0 */) override
void SetGUID(ObjectGuid const& guid, int32 /*type = 0 */) override
{
reviveGUID = guid;
}
@@ -612,7 +612,7 @@ public:
revivePlayerGUID.Clear();
}
void SetGUID(ObjectGuid const guid, int32 /*id*/) override
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
{
revivePlayerGUID = guid;
}

View File

@@ -93,7 +93,7 @@ public:
_faction = faction;
}
void SetGUID(ObjectGuid guid, int32) override
void SetGUID(ObjectGuid const& guid, int32) override
{
_playerGUID = guid;
me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE);

View File

@@ -118,7 +118,7 @@ public:
_events.ScheduleEvent(EVENT_MULTI_SHOT, 10s);
}
void SetGUID(ObjectGuid guid, int32 type) override
void SetGUID(ObjectGuid const& guid, int32 type) override
{
if (type == GUID_EVENT_INVOKER)
{

View File

@@ -1743,7 +1743,7 @@ struct npc_coren_direbrew_sisters : public ScriptedAI
{
npc_coren_direbrew_sisters(Creature* creature) : ScriptedAI(creature) { }
void SetGUID(ObjectGuid guid, int32 id) override
void SetGUID(ObjectGuid const& guid, int32 id) override
{
if (id == DATA_TARGET_GUID)
{

View File

@@ -335,7 +335,7 @@ struct boss_archimonde : public BossAI
Talk(SAY_SLAY);
}
void SetGUID(ObjectGuid guid, int32 type) override
void SetGUID(ObjectGuid const& guid, int32 type) override
{
if (type == GUID_GAIN_SOUL_CHARGE_PLAYER)
{

View File

@@ -154,7 +154,7 @@ struct boss_ossirian : public BossAI
}
}
void SetGUID(ObjectGuid guid, int32 action) override
void SetGUID(ObjectGuid const& guid, int32 action) override
{
if (action == ACTION_TRIGGER_WEAKNESS && guid != _firstCrystalGUID)
{
@@ -317,7 +317,7 @@ public:
{
go_ossirian_crystalAI(GameObject* go) : GameObjectAI(go), _instance(go->GetInstanceScript()) { }
void SetGUID(ObjectGuid guid, int32 type) override
void SetGUID(ObjectGuid const& guid, int32 type) override
{
if (type == GUID_TRIGGER_PAIR)
{

View File

@@ -552,7 +552,7 @@ public:
}
}
void SetGUID(ObjectGuid /*guid*/, int32 type) override
void SetGUID(ObjectGuid const& /*guid*/, int32 type) override
{
if (type == GUID_SCRIPT_INVOKER && _scriptRunning == false)
{

View File

@@ -129,7 +129,7 @@ public:
ImmuneFlagSet(false, _faction);
}
void SetGUID(ObjectGuid playerGUID, int32 faction) override
void SetGUID(ObjectGuid const& playerGUID, int32 faction) override
{
_playerGUID = playerGUID;
_faction = faction;

View File

@@ -1293,7 +1293,7 @@ public:
}
}
void SetGUID(ObjectGuid guid, int32 /*type*/) override
void SetGUID(ObjectGuid const& guid, int32 /*type*/) override
{
_chaseGUID = guid;
}

View File

@@ -533,7 +533,7 @@ public:
return _bloodboltedPlayers.count(guid) != 0;
}
void SetGUID(ObjectGuid guid, int32 type = 0) override
void SetGUID(ObjectGuid const& guid, int32 type = 0) override
{
switch (type)
{

View File

@@ -703,7 +703,7 @@ public:
}
}
void SetGUID(ObjectGuid guid, int32 id/* = 0*/) override
void SetGUID(ObjectGuid const& guid, int32 id/* = 0*/) override
{
if (id != ACTION_SHIP_VISITS_ENEMY && id != ACTION_SHIP_VISITS_SELF)
return;

View File

@@ -745,7 +745,7 @@ public:
ObjectGuid targetGUID;
void SetGUID(ObjectGuid guid, int32 type) override
void SetGUID(ObjectGuid const& guid, int32 type) override
{
if (type == -1)
targetGUID = guid;

View File

@@ -698,7 +698,7 @@ public:
uint32 _existenceCheckTimer;
uint16 _asphyxiationTimer;
void SetGUID(ObjectGuid guid, int32 type) override
void SetGUID(ObjectGuid const& guid, int32 type) override
{
if (type == DATA_TRAPPED_PLAYER)
_trappedPlayerGUID = guid;

View File

@@ -2536,7 +2536,7 @@ public:
}
}
void SetGUID(ObjectGuid guid, int32 /* = 0*/) override
void SetGUID(ObjectGuid const& guid, int32 /* = 0*/) override
{
_grabbedPlayer = guid;
}

View File

@@ -772,7 +772,7 @@ public:
}
}
void SetGUID(ObjectGuid guid, int32 type/* = 0*/) override
void SetGUID(ObjectGuid const& guid, int32 type/* = 0*/) override
{
if (type == ACTION_VRYKUL_DEATH)
{

View File

@@ -1421,7 +1421,7 @@ public:
_playerGUID.Clear();
}
void SetGUID(ObjectGuid guid, int32 /*action*/) override
void SetGUID(ObjectGuid const& guid, int32 /*action*/) override
{
if (_playerGUID)
return;

View File

@@ -1093,7 +1093,7 @@ public:
me->GetMotionMaster()->Clear();
}
void SetGUID(ObjectGuid guid, int32 /*id*/) override
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
{
if (playerGUID || events.HasTimeUntilEvent(998) || events.HasTimeUntilEvent(2))
return;

View File

@@ -241,7 +241,7 @@ struct npc_stolen_soul : public ScriptedAI
});
}
void SetGUID(ObjectGuid guid, int32 /*id*/) override
void SetGUID(ObjectGuid const& guid, int32 /*id*/) override
{
_targetGuid = guid;
}

View File

@@ -114,7 +114,7 @@ struct boss_murmur : public BossAI
return true;
}
void SetGUID(ObjectGuid guid, int32 index) override
void SetGUID(ObjectGuid const& guid, int32 index) override
{
if (index == GUID_MURMUR_NPCS)
{

View File

@@ -670,7 +670,7 @@ public:
}
// 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);

View File

@@ -303,7 +303,7 @@ public:
uint32 HealTimer;
uint32 FrostShockTimer;
void SetGUID(ObjectGuid guid, int32 /*questId*/) override
void SetGUID(ObjectGuid const& guid, int32 /*questId*/) override
{
me->SetStandState(UNIT_STAND_STATE_STAND);
Start(true, false, guid);

View File

@@ -99,7 +99,7 @@ public:
npc_escortAI::MoveInLineOfSight(who);
}
void SetGUID(ObjectGuid playerGUID, int32 type) override
void SetGUID(ObjectGuid const& playerGUID, int32 type) override
{
if (type == DATA_START_ENCOUNTER)
{

View File

@@ -219,7 +219,7 @@ public:
});
}
void SetGUID(ObjectGuid guid, int32 type) override
void SetGUID(ObjectGuid const& guid, int32 type) override
{
if (type == GUID_DRAGON)
{