mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 20:56:23 +00:00
refactor(GameObjectAI): Change self-accessor to "me" (#9041)
This commit is contained in:
@@ -1101,7 +1101,7 @@ public:
|
||||
bool GossipHello(Player* player, bool /*reportUse*/) override
|
||||
{
|
||||
bool hasKey = true;
|
||||
if (LockEntry const* lock = sLockStore.LookupEntry(go->GetGOInfo()->goober.lockId))
|
||||
if (LockEntry const* lock = sLockStore.LookupEntry(me->GetGOInfo()->goober.lockId))
|
||||
{
|
||||
hasKey = false;
|
||||
for (uint32 i = 0; i < MAX_LOCK_CASE; ++i)
|
||||
@@ -1124,18 +1124,18 @@ public:
|
||||
return false;
|
||||
_locked = true;
|
||||
// Start Algalon event
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
|
||||
me->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
|
||||
events.ScheduleEvent(EVENT_DESPAWN_CONSOLE, 5000);
|
||||
if (Creature* brann = go->SummonCreature(NPC_BRANN_BRONZBEARD_ALG, BrannIntroSpawnPos))
|
||||
if (Creature* brann = me->SummonCreature(NPC_BRANN_BRONZBEARD_ALG, BrannIntroSpawnPos))
|
||||
brann->AI()->DoAction(ACTION_START_INTRO);
|
||||
|
||||
if (InstanceScript* instance = go->GetInstanceScript())
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
{
|
||||
instance->SetData(DATA_ALGALON_SUMMON_STATE, 1);
|
||||
if (GameObject* sigil = ObjectAccessor::GetGameObject(*go, instance->GetGuidData(GO_DOODAD_UL_SIGILDOOR_01)))
|
||||
if (GameObject* sigil = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_DOODAD_UL_SIGILDOOR_01)))
|
||||
sigil->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
if (GameObject* sigil = ObjectAccessor::GetGameObject(*go, instance->GetGuidData(GO_DOODAD_UL_SIGILDOOR_02)))
|
||||
if (GameObject* sigil = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_DOODAD_UL_SIGILDOOR_02)))
|
||||
sigil->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
|
||||
@@ -1151,7 +1151,7 @@ public:
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_DESPAWN_CONSOLE:
|
||||
go->Delete();
|
||||
me->Delete();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -755,8 +755,8 @@ public:
|
||||
|
||||
bool IsFriendly(Unit* passenger)
|
||||
{
|
||||
return ((go->GetUInt32Value(GAMEOBJECT_FACTION) == WintergraspFaction[TEAM_HORDE] && passenger->getRaceMask() & RACEMASK_HORDE) ||
|
||||
(go->GetUInt32Value(GAMEOBJECT_FACTION) == WintergraspFaction[TEAM_ALLIANCE] && passenger->getRaceMask() & RACEMASK_ALLIANCE));
|
||||
return ((me->GetUInt32Value(GAMEOBJECT_FACTION) == WintergraspFaction[TEAM_HORDE] && passenger->getRaceMask() & RACEMASK_HORDE) ||
|
||||
(me->GetUInt32Value(GAMEOBJECT_FACTION) == WintergraspFaction[TEAM_ALLIANCE] && passenger->getRaceMask() & RACEMASK_ALLIANCE));
|
||||
}
|
||||
|
||||
Creature* IsValidVehicle(Creature* cVeh)
|
||||
@@ -765,7 +765,7 @@ public:
|
||||
if (Vehicle* vehicle = cVeh->GetVehicleKit())
|
||||
if (Unit* passenger = vehicle->GetPassenger(0))
|
||||
if (IsFriendly(passenger))
|
||||
if (Creature* teleportTrigger = passenger->SummonTrigger(go->GetPositionX() - 60.0f, go->GetPositionY(), go->GetPositionZ() + 1.0f, cVeh->GetOrientation(), 1000))
|
||||
if (Creature* teleportTrigger = passenger->SummonTrigger(me->GetPositionX() - 60.0f, me->GetPositionY(), me->GetPositionZ() + 1.0f, cVeh->GetOrientation(), 1000))
|
||||
return teleportTrigger;
|
||||
|
||||
return nullptr;
|
||||
@@ -777,7 +777,7 @@ public:
|
||||
if (_checkTimer >= 1000)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_WINTERGRASP_VEHICLES; i++)
|
||||
if (Creature* vehicleCreature = go->FindNearestCreature(vehiclesList[i], 3.0f, true))
|
||||
if (Creature* vehicleCreature = me->FindNearestCreature(vehiclesList[i], 3.0f, true))
|
||||
if (Creature* teleportTrigger = IsValidVehicle(vehicleCreature))
|
||||
teleportTrigger->CastSpell(vehicleCreature, SPELL_VEHICLE_TELEPORT, true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user