refactor(Core/Misc): isEmpty to IsEmpty (#10011)

This commit is contained in:
Kitzunu
2022-01-14 03:43:15 +01:00
committed by GitHub
parent e36ee257c7
commit d1cc65b1c7
50 changed files with 94 additions and 94 deletions

View File

@@ -181,7 +181,7 @@ public:
// check if all players saved her.
Map::PlayerList const& lPlayers = instance->GetPlayers();
if (!lPlayers.isEmpty())
if (!lPlayers.IsEmpty())
{
for (Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr)
{

View File

@@ -309,7 +309,7 @@ public:
return;
Map::PlayerList const& PlayerList = map->GetPlayers();
if (PlayerList.isEmpty())
if (PlayerList.IsEmpty())
return;
RaidWiped = true;

View File

@@ -432,7 +432,7 @@ public:
void SendUpdateWorldState(uint32 id, uint32 state)
{
Map::PlayerList const& players = me->GetMap()->GetPlayers();
if (!players.isEmpty())
if (!players.IsEmpty())
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
if (Player* player = itr->GetSource())
if (player->GetPhaseMask() & 128) // Xinef: client skips players without chapter 5 aura anyway, speedup
@@ -1125,7 +1125,7 @@ public:
case EVENT_OUTRO_SCENE_60:
{
Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
if (!PlayerList.isEmpty())
if (!PlayerList.IsEmpty())
{
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (i->GetSource()->IsAlive() && me->IsWithinDistInMap(i->GetSource(), 100))

View File

@@ -508,7 +508,7 @@ public:
case EVENT_FORCE_SLAUGHTER_EVENT:
{
Map::PlayerList const& PlayerList = instance->GetPlayers();
if (!PlayerList.isEmpty())
if (!PlayerList.IsEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* player = i->GetSource())
if (player->GetDistance2d(4034.97f, -3402.13f) < 50.0f)

View File

@@ -56,7 +56,7 @@ public:
{
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
if (!players.IsEmpty())
{
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{

View File

@@ -186,7 +186,7 @@ public:
return;
Map::PlayerList const& PlayerList = instance->GetPlayers();
if (PlayerList.isEmpty())
if (PlayerList.IsEmpty())
return;
Map::PlayerList::const_iterator i = PlayerList.begin();

View File

@@ -1146,7 +1146,7 @@ public:
{
Map::PlayerList const& players = map->GetPlayers();
if (!players.isEmpty())
if (!players.IsEmpty())
{
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
@@ -2534,7 +2534,7 @@ public:
{
Map::PlayerList const& players = map->GetPlayers();
if (!players.isEmpty())
if (!players.IsEmpty())
{
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{

View File

@@ -1641,7 +1641,7 @@ struct npc_coren_direbrew : public ScriptedAI
_summons.DespawnAll();
Map::PlayerList const& players = me->GetMap()->GetPlayers();
if (!players.isEmpty())
if (!players.IsEmpty())
{
if (Group* group = players.begin()->GetSource()->GetGroup())
{

View File

@@ -983,7 +983,7 @@ struct boss_headless_horseman : public ScriptedAI
(*itr)->ToCreature()->DespawnOrUnsummon(500);
Map::PlayerList const& players = me->GetMap()->GetPlayers();
if (!players.isEmpty() && players.begin()->GetSource() && players.begin()->GetSource()->GetGroup())
if (!players.IsEmpty() && players.begin()->GetSource() && players.begin()->GetSource()->GetGroup())
sLFGMgr->FinishDungeon(players.begin()->GetSource()->GetGroup()->GetGUID(), lfg::LFG_DUNGEON_HEADLESS_HORSEMAN, me->FindMap());
}

View File

@@ -334,7 +334,7 @@ struct npc_love_in_air_hummel : public ScriptedAI
{
me->AI()->Talk(SAY_HUMMEL_5);
Map::PlayerList const& players = me->GetMap()->GetPlayers();
if (!players.isEmpty() && players.begin()->GetSource() && players.begin()->GetSource()->GetGroup())
if (!players.IsEmpty() && players.begin()->GetSource() && players.begin()->GetSource()->GetGroup())
sLFGMgr->FinishDungeon(players.begin()->GetSource()->GetGroup()->GetGUID(), lfg::LFG_DUNGEON_CROWN_CHEMICAL_CO, me->FindMap());
}

View File

@@ -189,7 +189,7 @@ public:
{
unit->SetVisible(false);
Map::PlayerList const& PlayerList = map->GetPlayers();
if (PlayerList.isEmpty())
if (PlayerList.IsEmpty())
return;
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)

View File

@@ -493,7 +493,7 @@ public:
actionEvents.ScheduleEvent(EVENT_ACTION_PHASE5 + 1, 22000);
me->SetFacingTo(1.84f);
if (!me->GetMap()->GetPlayers().isEmpty())
if (!me->GetMap()->GetPlayers().IsEmpty())
if (Player* player = me->GetMap()->GetPlayers().getFirst()->GetSource())
player->RewardPlayerAndGroupAtEvent(31006, player); // Malganis quest entry required
}
@@ -1153,7 +1153,7 @@ public:
if (GameObject* go = pInstance->instance->GetGameObject(pInstance->GetGuidData(DATA_EXIT_GATE)))
go->SetGoState(GO_STATE_ACTIVE);
if (!me->GetMap()->GetPlayers().isEmpty())
if (!me->GetMap()->GetPlayers().IsEmpty())
if (Player* player = me->GetMap()->GetPlayers().getFirst()->GetSource())
player->SummonGameObject(DUNGEON_MODE(GO_MALGANIS_CHEST_N, GO_MALGANIS_CHEST_H), 2288.35f, 1498.73f, 128.414f, -0.994837f, 0, 0, 0, 0, 0);
}
@@ -1219,7 +1219,7 @@ void npc_arthas::npc_arthasAI::ScheduleNextEvent(uint32 currentEvent, uint32 tim
void npc_arthas::npc_arthasAI::SummonNextWave()
{
Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
if (!PlayerList.isEmpty())
if (!PlayerList.IsEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
i->GetSource()->PlayerTalkClass->SendPointOfInterest(1000 + waveGroupId);

View File

@@ -140,7 +140,7 @@ public:
if (_crateCount == 5)
{
Map::PlayerList const& PlayerList = instance->GetPlayers();
if (!PlayerList.isEmpty())
if (!PlayerList.IsEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
i->GetSource()->KilledMonsterCredit(NPC_GRAIN_CREATE_TRIGGER);
@@ -298,7 +298,7 @@ public:
void ChromieWhisper(uint8 textId)
{
if (!instance->GetPlayers().isEmpty())
if (!instance->GetPlayers().IsEmpty())
if (Player* player = instance->GetPlayers().getFirst()->GetSource())
{
Position pos = player->GetPosition();

View File

@@ -221,7 +221,7 @@ public:
if (_encounterProgress == ENCOUNTER_PROGRESS_NONE)
{
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
if (!players.IsEmpty())
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
if (Player* player = itr->GetSource())
player->KilledMonsterCredit(NPC_LODGE_QUEST_TRIGGER);

View File

@@ -710,7 +710,7 @@ public:
case EVENT_THRALL_FACE_TARETHA:
{
Map::PlayerList const& players = me->GetMap()->GetPlayers();
if (!players.isEmpty())
if (!players.IsEmpty())
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
if (Player* player = itr->GetSource())
player->KilledMonsterCredit(20156);

View File

@@ -157,7 +157,7 @@ public:
medivh->AI()->DoAction(ACTION_OUTRO);
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
if (!players.IsEmpty())
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
if (Player* player = itr->GetSource())
{

View File

@@ -593,7 +593,7 @@ public:
//Play random sound to the zone
Map::PlayerList const& PlayerList = map->GetPlayers();
if (!PlayerList.isEmpty())
if (!PlayerList.IsEmpty())
{
for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
{

View File

@@ -97,7 +97,7 @@ public:
if (TeamIdInInstance == TEAM_NEUTRAL)
{
Map::PlayerList const& players = instance->GetPlayers();
if( !players.isEmpty() )
if( !players.IsEmpty() )
if( Player* pPlayer = players.begin()->GetSource() )
TeamIdInInstance = pPlayer->GetTeamId();
}

View File

@@ -74,7 +74,7 @@ public:
if (teamIdInInstance == TEAM_NEUTRAL)
{
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
if (!players.IsEmpty())
if (Player* player = players.begin()->GetSource())
teamIdInInstance = player->GetTeamId();
}

View File

@@ -204,7 +204,7 @@ public:
if (TeamIdInInstance == TEAM_NEUTRAL)
{
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
if (!players.IsEmpty())
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
if (Player* p = itr->GetSource())
if (!p->IsGameMaster())

View File

@@ -83,7 +83,7 @@ public:
if (teamIdInInstance == TEAM_NEUTRAL)
{
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
if (!players.IsEmpty())
if (Player* player = players.begin()->GetSource())
teamIdInInstance = player->GetTeamId();
}
@@ -109,7 +109,7 @@ public:
if (teamIdInInstance == TEAM_NEUTRAL)
{
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
if (!players.IsEmpty())
if (Player* player = players.begin()->GetSource())
teamIdInInstance = player->GetTeamId();
}

View File

@@ -363,7 +363,7 @@ void SendPacketToPlayers(WorldPacket const* data, Unit* source)
{
// Send packet to all players in The Frozen Throne
Map::PlayerList const& players = source->GetMap()->GetPlayers();
if (!players.isEmpty())
if (!players.IsEmpty())
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
if (Player* player = itr->GetSource())
if (player->GetAreaId() == AREA_THE_FROZEN_THRONE)
@@ -973,7 +973,7 @@ public:
{
_positionCheckTimer = 5000;
Map::PlayerList const& players = me->GetMap()->GetPlayers();
if (!players.isEmpty())
if (!players.IsEmpty())
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
if (Player* player = itr->GetSource())
if (player->GetPositionZ() < 700.0f)

View File

@@ -238,7 +238,7 @@ public:
if (TeamIdInInstance == TEAM_NEUTRAL)
{
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
if (!players.IsEmpty())
if (Player* player = players.begin()->GetSource())
TeamIdInInstance = player->GetTeamId();
}
@@ -485,7 +485,7 @@ public:
if (TeamIdInInstance == TEAM_NEUTRAL)
{
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
if (!players.IsEmpty())
if (Player* player = players.begin()->GetSource())
TeamIdInInstance = player->GetTeamId();
}
@@ -530,7 +530,7 @@ public:
if (TeamIdInInstance == TEAM_NEUTRAL)
{
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
if (!players.IsEmpty())
if (Player* player = players.begin()->GetSource())
TeamIdInInstance = player->GetTeamId();
}
@@ -634,7 +634,7 @@ public:
if (TeamIdInInstance == TEAM_NEUTRAL)
{
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
if (!players.IsEmpty())
if (Player* player = players.begin()->GetSource())
TeamIdInInstance = player->GetTeamId();
}
@@ -1632,7 +1632,7 @@ public:
{
LichKingRandomWhisperTimer = urand(100, 300) * IN_MILLISECONDS;
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
if (!players.IsEmpty())
if (Player* player = players.begin()->GetSource())
if (player->GetQuestStatus(QUEST_A_FEAST_OF_SOULS) == QUEST_STATUS_INCOMPLETE)
{

View File

@@ -276,7 +276,7 @@ public:
{
if (pInstance->GetBossState(BOSS_HORSEMAN) == DONE)
{
if (!me->GetMap()->GetPlayers().isEmpty())
if (!me->GetMap()->GetPlayers().IsEmpty())
{
if (Player* player = me->GetMap()->GetPlayers().getFirst()->GetSource())
{

View File

@@ -353,7 +353,7 @@ public:
bool CheckGroupSplitted()
{
Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
if (!PlayerList.isEmpty())
if (!PlayerList.IsEmpty())
{
bool checklife = false;
bool checkdead = false;

View File

@@ -138,7 +138,7 @@ public:
void EnterCombatSelfFunction()
{
Map::PlayerList const& PlList = me->GetMap()->GetPlayers();
if (PlList.isEmpty())
if (PlList.IsEmpty())
return;
for (const auto& i : PlList)

View File

@@ -494,7 +494,7 @@ public:
vp->SetDisableGravity(true);
Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
if (!PlayerList.isEmpty())
if (!PlayerList.IsEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* pPlayer = i->GetSource())
{
@@ -714,7 +714,7 @@ public:
// mount players:
Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
if (!PlayerList.isEmpty())
if (!PlayerList.IsEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* pPlayer = i->GetSource())
{
@@ -1196,7 +1196,7 @@ public:
{
GuidVector guids;
Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
if (!PlayerList.isEmpty())
if (!PlayerList.IsEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* pPlayer = i->GetSource())
{

View File

@@ -51,7 +51,7 @@ public:
{
Map::PlayerList const& players = instance->GetPlayers();
TeamId TeamIdInInstance = TEAM_NEUTRAL;
if (!players.isEmpty())
if (!players.IsEmpty())
if (Player* pPlayer = players.begin()->GetSource())
TeamIdInInstance = pPlayer->GetTeamId();

View File

@@ -338,7 +338,7 @@ public:
case ACTION_START_TRIBUNAL:
{
Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
if (!PlayerList.isEmpty())
if (!PlayerList.IsEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
me->SetFaction(i->GetSource()->GetFaction());

View File

@@ -78,7 +78,7 @@ public:
if (bf->GetTimer() <= (16 * MINUTE * IN_MILLISECONDS) && bf->GetTimer() >= (15 * MINUTE * IN_MILLISECONDS))
{
Map::PlayerList const& PlayerList = instance->GetPlayers();
if (!PlayerList.isEmpty())
if (!PlayerList.IsEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* player = i->GetSource())
player->TextEmote("This instance will reset in 15 minutes.", nullptr, true);
@@ -102,7 +102,7 @@ public:
else if (bf->GetTimer() <= (2 * MINUTE * IN_MILLISECONDS) && bf->GetTimer() > (MINUTE * IN_MILLISECONDS))
{
Map::PlayerList const& PlayerList = instance->GetPlayers();
if (!PlayerList.isEmpty())
if (!PlayerList.IsEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* player = i->GetSource())
player->TextEmote("This instance is about to reset. Prepare to be removed.", nullptr, true);
@@ -115,7 +115,7 @@ public:
cr->AI()->EnterEvadeMode();
Map::PlayerList const& PlayerList = instance->GetPlayers();
if (!PlayerList.isEmpty())
if (!PlayerList.IsEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* player = i->GetSource())
player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, player->GetOrientation());

View File

@@ -145,7 +145,7 @@ public:
void IchoronDoCastToAllHostilePlayers(uint32 spellId, bool triggered)
{
Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
if (PlayerList.isEmpty())
if (PlayerList.IsEmpty())
return;
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)

View File

@@ -302,7 +302,7 @@ public:
bool finished = false;
Map::PlayerList const& players = me->GetMap()->GetPlayers();
if (!players.isEmpty())
if (!players.IsEmpty())
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
if (Player* player = i->GetSource())
{

View File

@@ -70,7 +70,7 @@ public:
if (TeamIdInInstance == TEAM_NEUTRAL)
{
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
if (!players.IsEmpty())
if (Player* player = players.begin()->GetSource())
TeamIdInInstance = player->GetTeamId();
}