refactor(Core/Misc): isEmpty to IsEmpty (#10011)
This commit is contained in:
@@ -94,13 +94,13 @@ public:
|
||||
iLast.iPrev = &iFirst;
|
||||
}
|
||||
|
||||
[[nodiscard]] bool isEmpty() const { return (!iFirst.iNext->isInList()); }
|
||||
[[nodiscard]] bool IsEmpty() const { return (!iFirst.iNext->isInList()); }
|
||||
|
||||
LinkedListElement* getFirst() { return (isEmpty() ? nullptr : iFirst.iNext); }
|
||||
[[nodiscard]] LinkedListElement const* getFirst() const { return (isEmpty() ? nullptr : iFirst.iNext); }
|
||||
LinkedListElement* getFirst() { return (IsEmpty() ? nullptr : iFirst.iNext); }
|
||||
[[nodiscard]] LinkedListElement const* getFirst() const { return (IsEmpty() ? nullptr : iFirst.iNext); }
|
||||
|
||||
LinkedListElement* getLast() { return (isEmpty() ? nullptr : iLast.iPrev); }
|
||||
[[nodiscard]] LinkedListElement const* getLast() const { return (isEmpty() ? nullptr : iLast.iPrev); }
|
||||
LinkedListElement* getLast() { return (IsEmpty() ? nullptr : iLast.iPrev); }
|
||||
[[nodiscard]] LinkedListElement const* getLast() const { return (IsEmpty() ? nullptr : iLast.iPrev); }
|
||||
|
||||
void insertFirst(LinkedListElement* pElem)
|
||||
{
|
||||
|
||||
@@ -106,7 +106,7 @@ void CreatureAI::DoZoneInCombat(Creature* creature /*= nullptr*/, float maxRange
|
||||
}
|
||||
|
||||
Map::PlayerList const& playerList = map->GetPlayers();
|
||||
if (playerList.isEmpty())
|
||||
if (playerList.IsEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ void ScriptedAI::DoPlayMusic(uint32 soundId, bool zone)
|
||||
Map::PlayerList const& players = me->GetMap()->GetPlayers();
|
||||
targets = new ObjectList();
|
||||
|
||||
if (!players.isEmpty())
|
||||
if (!players.IsEmpty())
|
||||
{
|
||||
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
if (Player* player = i->GetSource())
|
||||
|
||||
@@ -301,7 +301,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
Map::PlayerList const& players = me->GetMap()->GetPlayers();
|
||||
targets = new ObjectList();
|
||||
|
||||
if (!players.isEmpty())
|
||||
if (!players.IsEmpty())
|
||||
{
|
||||
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
if (Player* player = i->GetSource())
|
||||
@@ -350,7 +350,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
Map::PlayerList const& players = me->GetMap()->GetPlayers();
|
||||
targets = new ObjectList();
|
||||
|
||||
if (!players.isEmpty())
|
||||
if (!players.IsEmpty())
|
||||
{
|
||||
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
if (Player* player = i->GetSource())
|
||||
|
||||
@@ -63,7 +63,7 @@ void FormationMgr::RemoveCreatureFromGroup(CreatureGroup* group, Creature* membe
|
||||
LOG_DEBUG("entities.unit", "Deleting member pointer to spawnId: %u from group %u", member->GetSpawnId(), group->GetId());
|
||||
group->RemoveMember(member);
|
||||
|
||||
if (group->isEmpty())
|
||||
if (group->IsEmpty())
|
||||
{
|
||||
Map* map = member->FindMap();
|
||||
if (!map)
|
||||
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
|
||||
Creature* getLeader() const { return m_leader; }
|
||||
uint32 GetId() const { return m_groupID; }
|
||||
bool isEmpty() const { return m_members.empty(); }
|
||||
bool IsEmpty() const { return m_members.empty(); }
|
||||
bool isFormed() const { return m_Formed; }
|
||||
const CreatureGroupMemberType& GetMembers() const { return m_members; }
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ void MotionTransport::CleanupsBeforeDelete(bool finalCleanup /*= true*/)
|
||||
void MotionTransport::BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet&)
|
||||
{
|
||||
Map::PlayerList const& players = GetMap()->GetPlayers();
|
||||
if (players.isEmpty())
|
||||
if (players.IsEmpty())
|
||||
return;
|
||||
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
@@ -798,7 +798,7 @@ void StaticTransport::CleanupsBeforeDelete(bool finalCleanup /*= true*/)
|
||||
void StaticTransport::BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet&)
|
||||
{
|
||||
Map::PlayerList const& players = GetMap()->GetPlayers();
|
||||
if (players.isEmpty())
|
||||
if (players.IsEmpty())
|
||||
return;
|
||||
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
|
||||
@@ -416,7 +416,7 @@ void Unit::Update(uint32 p_time)
|
||||
// Check UNIT_STATE_MELEE_ATTACKING or UNIT_STATE_CHASE (without UNIT_STATE_FOLLOW in this case) so pets can reach far away
|
||||
// targets without stopping half way there and running off.
|
||||
// These flags are reset after target dies or another command is given.
|
||||
if (m_HostileRefMgr.isEmpty())
|
||||
if (m_HostileRefMgr.IsEmpty())
|
||||
{
|
||||
// m_CombatTimer set at aura start and it will be freeze until aura removing
|
||||
if (m_CombatTimer <= p_time)
|
||||
|
||||
@@ -115,12 +115,12 @@ public:
|
||||
|
||||
/*bool NoWorldObjectInGrid() const
|
||||
{
|
||||
return i_objects.GetElements().isEmpty();
|
||||
return i_objects.GetElements().IsEmpty();
|
||||
}
|
||||
|
||||
bool NoGridObjectInGrid() const
|
||||
{
|
||||
return i_container.GetElements().isEmpty();
|
||||
return i_container.GetElements().IsEmpty();
|
||||
}*/
|
||||
private:
|
||||
TypeMapContainer<GRID_OBJECT_TYPES> i_container;
|
||||
|
||||
@@ -200,7 +200,7 @@ void ObjectGridLoader::LoadN(void)
|
||||
template<class T>
|
||||
void ObjectGridUnloader::Visit(GridRefMgr<T>& m)
|
||||
{
|
||||
while (!m.isEmpty())
|
||||
while (!m.IsEmpty())
|
||||
{
|
||||
T* obj = m.getFirst()->GetSource();
|
||||
// if option set then object already saved at this moment
|
||||
|
||||
@@ -126,7 +126,7 @@ void WorldSession::HandleMoveWorldportAck()
|
||||
_player->m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
|
||||
}
|
||||
|
||||
if (!_player->getHostileRefMgr().isEmpty())
|
||||
if (!_player->getHostileRefMgr().IsEmpty())
|
||||
_player->getHostileRefMgr().deleteReferences(true); // pussywizard: multithreading crashfix
|
||||
|
||||
CellCoord pair(Acore::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY()));
|
||||
|
||||
@@ -412,7 +412,7 @@ void InstanceScript::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData)
|
||||
{
|
||||
Map::PlayerList const& lPlayers = instance->GetPlayers();
|
||||
|
||||
if (!lPlayers.isEmpty())
|
||||
if (!lPlayers.IsEmpty())
|
||||
{
|
||||
for (Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr)
|
||||
if (Player* player = itr->GetSource())
|
||||
@@ -429,7 +429,7 @@ void InstanceScript::DoSendNotifyToInstance(char const* format, ...)
|
||||
{
|
||||
InstanceMap::PlayerList const& players = instance->GetPlayers();
|
||||
|
||||
if (!players.isEmpty())
|
||||
if (!players.IsEmpty())
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
@@ -447,7 +447,7 @@ void InstanceScript::DoUpdateAchievementCriteria(AchievementCriteriaTypes type,
|
||||
{
|
||||
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->UpdateAchievementCriteria(type, miscValue1, miscValue2, unit);
|
||||
@@ -458,7 +458,7 @@ void InstanceScript::DoStartTimedAchievement(AchievementCriteriaTimedTypes type,
|
||||
{
|
||||
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->StartTimedAchievement(type, entry);
|
||||
@@ -469,7 +469,7 @@ void InstanceScript::DoStopTimedAchievement(AchievementCriteriaTimedTypes type,
|
||||
{
|
||||
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->RemoveTimedAchievement(type, entry);
|
||||
@@ -479,7 +479,7 @@ void InstanceScript::DoStopTimedAchievement(AchievementCriteriaTimedTypes type,
|
||||
void InstanceScript::DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
|
||||
{
|
||||
Map::PlayerList const& PlayerList = instance->GetPlayers();
|
||||
if (!PlayerList.isEmpty())
|
||||
if (!PlayerList.IsEmpty())
|
||||
{
|
||||
for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
|
||||
{
|
||||
@@ -498,7 +498,7 @@ void InstanceScript::DoCastSpellOnPlayers(uint32 spell)
|
||||
{
|
||||
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->CastSpell(player, spell, true);
|
||||
|
||||
@@ -628,7 +628,7 @@ bool Map::AddToMap(MotionTransport* obj, bool /*checkTransport*/)
|
||||
_transports.insert(obj);
|
||||
|
||||
// Broadcast creation to players
|
||||
if (!GetPlayers().isEmpty())
|
||||
if (!GetPlayers().IsEmpty())
|
||||
{
|
||||
for (Map::PlayerList::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
|
||||
{
|
||||
@@ -957,7 +957,7 @@ void Map::RemoveFromMap(MotionTransport* obj, bool remove)
|
||||
RemoveFromActive(obj);
|
||||
|
||||
Map::PlayerList const& players = GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
if (!players.IsEmpty())
|
||||
{
|
||||
UpdateData data;
|
||||
obj->BuildOutOfRangeUpdateBlock(&data);
|
||||
@@ -2873,7 +2873,7 @@ Map::EnterState InstanceMap::CannotEnter(Player* player, bool loginCheck)
|
||||
|
||||
// cannot enter if instance is in use by another party/soloer that have a permanent save in the same instance id
|
||||
PlayerList const& playerList = GetPlayers();
|
||||
if (!playerList.isEmpty())
|
||||
if (!playerList.IsEmpty())
|
||||
for (PlayerList::const_iterator i = playerList.begin(); i != playerList.end(); ++i)
|
||||
if (Player* iPlayer = i->GetSource())
|
||||
{
|
||||
@@ -3066,7 +3066,7 @@ bool InstanceMap::Reset(uint8 method, GuidList* globalResetSkipList)
|
||||
m_resetAfterUnload = true;
|
||||
}
|
||||
|
||||
return m_mapRefMgr.isEmpty();
|
||||
return m_mapRefMgr.IsEmpty();
|
||||
}
|
||||
|
||||
if (HavePlayers())
|
||||
@@ -3083,7 +3083,7 @@ bool InstanceMap::Reset(uint8 method, GuidList* globalResetSkipList)
|
||||
m_resetAfterUnload = true;
|
||||
}
|
||||
|
||||
return m_mapRefMgr.isEmpty();
|
||||
return m_mapRefMgr.IsEmpty();
|
||||
}
|
||||
|
||||
std::string const& InstanceMap::GetScriptName() const
|
||||
@@ -3679,7 +3679,7 @@ void Map::SendZoneDynamicInfo(Player* player)
|
||||
void Map::PlayDirectSoundToMap(uint32 soundId, uint32 zoneId)
|
||||
{
|
||||
Map::PlayerList const& players = GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
if (!players.IsEmpty())
|
||||
{
|
||||
WorldPacket data(SMSG_PLAY_SOUND, 4);
|
||||
data << uint32(soundId);
|
||||
@@ -3699,7 +3699,7 @@ void Map::SetZoneMusic(uint32 zoneId, uint32 musicId)
|
||||
_zoneDynamicInfo[zoneId].MusicId = musicId;
|
||||
|
||||
Map::PlayerList const& players = GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
if (!players.IsEmpty())
|
||||
{
|
||||
WorldPacket data(SMSG_PLAY_MUSIC, 4);
|
||||
data << uint32(musicId);
|
||||
@@ -3721,7 +3721,7 @@ void Map::SetZoneWeather(uint32 zoneId, WeatherState weatherId, float weatherGra
|
||||
info.WeatherGrade = weatherGrade;
|
||||
Map::PlayerList const& players = GetPlayers();
|
||||
|
||||
if (!players.isEmpty())
|
||||
if (!players.IsEmpty())
|
||||
{
|
||||
WorldPackets::Misc::Weather weather(weatherId, weatherGrade);
|
||||
|
||||
@@ -3742,7 +3742,7 @@ void Map::SetZoneOverrideLight(uint32 zoneId, uint32 lightId, Milliseconds fadeI
|
||||
info.LightFadeInTime = static_cast<uint32>(fadeInTime.count());
|
||||
Map::PlayerList const& players = GetPlayers();
|
||||
|
||||
if (!players.isEmpty())
|
||||
if (!players.IsEmpty())
|
||||
{
|
||||
WorldPacket data(SMSG_OVERRIDE_LIGHT, 4 + 4 + 4);
|
||||
data << uint32(_defaultLight);
|
||||
|
||||
@@ -462,7 +462,7 @@ public:
|
||||
bool isCellMarkedLarge(uint32 pCellId) { return marked_cells_large.test(pCellId); }
|
||||
void markCellLarge(uint32 pCellId) { marked_cells_large.set(pCellId); }
|
||||
|
||||
[[nodiscard]] bool HavePlayers() const { return !m_mapRefMgr.isEmpty(); }
|
||||
[[nodiscard]] bool HavePlayers() const { return !m_mapRefMgr.IsEmpty(); }
|
||||
[[nodiscard]] uint32 GetPlayersCountExceptGMs() const;
|
||||
|
||||
void AddWorldObject(WorldObject* obj) { i_worldObjects.insert(obj); }
|
||||
|
||||
@@ -973,7 +973,7 @@ void PoolMgr::SaveQuestsToDB(bool daily, bool weekly, bool other)
|
||||
std::set<uint32> deletedPools;
|
||||
for (PoolGroupQuestMap::iterator itr = mPoolQuestGroups.begin(); itr != mPoolQuestGroups.end(); ++itr)
|
||||
{
|
||||
if (itr->second.isEmpty())
|
||||
if (itr->second.IsEmpty())
|
||||
continue;
|
||||
if (Quest const* quest = sObjectMgr->GetQuestTemplate(itr->second.GetFirstEqualChancedObjectId()))
|
||||
{
|
||||
@@ -1041,7 +1041,7 @@ template<>
|
||||
void PoolMgr::SpawnPool<Creature>(uint32 pool_id, uint32 db_guid)
|
||||
{
|
||||
auto it = mPoolCreatureGroups.find(pool_id);
|
||||
if (it != mPoolCreatureGroups.end() && !it->second.isEmpty())
|
||||
if (it != mPoolCreatureGroups.end() && !it->second.IsEmpty())
|
||||
it->second.SpawnObject(mSpawnedData, mPoolTemplate[pool_id].MaxLimit, db_guid);
|
||||
}
|
||||
|
||||
@@ -1051,7 +1051,7 @@ template<>
|
||||
void PoolMgr::SpawnPool<GameObject>(uint32 pool_id, uint32 db_guid)
|
||||
{
|
||||
auto it = mPoolGameobjectGroups.find(pool_id);
|
||||
if (it != mPoolGameobjectGroups.end() && !it->second.isEmpty())
|
||||
if (it != mPoolGameobjectGroups.end() && !it->second.IsEmpty())
|
||||
it->second.SpawnObject(mSpawnedData, mPoolTemplate[pool_id].MaxLimit, db_guid);
|
||||
}
|
||||
|
||||
@@ -1061,7 +1061,7 @@ template<>
|
||||
void PoolMgr::SpawnPool<Pool>(uint32 pool_id, uint32 sub_pool_id)
|
||||
{
|
||||
auto it = mPoolPoolGroups.find(pool_id);
|
||||
if (it != mPoolPoolGroups.end() && !it->second.isEmpty())
|
||||
if (it != mPoolPoolGroups.end() && !it->second.IsEmpty())
|
||||
it->second.SpawnObject(mSpawnedData, mPoolTemplate[pool_id].MaxLimit, sub_pool_id);
|
||||
}
|
||||
|
||||
@@ -1070,7 +1070,7 @@ template<>
|
||||
void PoolMgr::SpawnPool<Quest>(uint32 pool_id, uint32 quest_id)
|
||||
{
|
||||
auto it = mPoolQuestGroups.find(pool_id);
|
||||
if (it != mPoolQuestGroups.end() && !it->second.isEmpty())
|
||||
if (it != mPoolQuestGroups.end() && !it->second.IsEmpty())
|
||||
it->second.SpawnObject(mSpawnedData, mPoolTemplate[pool_id].MaxLimit, quest_id);
|
||||
}
|
||||
|
||||
@@ -1087,22 +1087,22 @@ void PoolMgr::DespawnPool(uint32 pool_id)
|
||||
{
|
||||
{
|
||||
auto it = mPoolCreatureGroups.find(pool_id);
|
||||
if (it != mPoolCreatureGroups.end() && !it->second.isEmpty())
|
||||
if (it != mPoolCreatureGroups.end() && !it->second.IsEmpty())
|
||||
it->second.DespawnObject(mSpawnedData);
|
||||
}
|
||||
{
|
||||
auto it = mPoolGameobjectGroups.find(pool_id);
|
||||
if (it != mPoolGameobjectGroups.end() && !it->second.isEmpty())
|
||||
if (it != mPoolGameobjectGroups.end() && !it->second.IsEmpty())
|
||||
it->second.DespawnObject(mSpawnedData);
|
||||
}
|
||||
{
|
||||
auto it = mPoolPoolGroups.find(pool_id);
|
||||
if (it != mPoolPoolGroups.end() && !it->second.isEmpty())
|
||||
if (it != mPoolPoolGroups.end() && !it->second.IsEmpty())
|
||||
it->second.DespawnObject(mSpawnedData);
|
||||
}
|
||||
{
|
||||
auto it = mPoolQuestGroups.find(pool_id);
|
||||
if (it != mPoolQuestGroups.end() && !it->second.isEmpty())
|
||||
if (it != mPoolQuestGroups.end() && !it->second.IsEmpty())
|
||||
it->second.DespawnObject(mSpawnedData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
explicit PoolGroup() : poolId(0) { }
|
||||
void SetPoolId(uint32 pool_id) { poolId = pool_id; }
|
||||
~PoolGroup() {};
|
||||
bool isEmpty() const { return ExplicitlyChanced.empty() && EqualChanced.empty(); }
|
||||
bool IsEmpty() const { return ExplicitlyChanced.empty() && EqualChanced.empty(); }
|
||||
void AddEntry(PoolObject& poolitem, uint32 maxentries);
|
||||
bool CheckPool() const;
|
||||
void DespawnObject(ActivePoolData& spawns, ObjectGuid::LowType guid = 0);
|
||||
|
||||
@@ -657,7 +657,7 @@ void WorldSession::LogoutPlayer(bool save)
|
||||
Map::PlayerList const& playerList = _player->GetMap()->GetPlayers();
|
||||
|
||||
if (_player->GetMap()->IsDungeon() || _player->GetMap()->IsRaidOrHeroicDungeon())
|
||||
if (playerList.isEmpty())
|
||||
if (playerList.IsEmpty())
|
||||
_player->TeleportToEntryPoint();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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)
|
||||
{
|
||||
|
||||
@@ -309,7 +309,7 @@ public:
|
||||
return;
|
||||
|
||||
Map::PlayerList const& PlayerList = map->GetPlayers();
|
||||
if (PlayerList.isEmpty())
|
||||
if (PlayerList.IsEmpty())
|
||||
return;
|
||||
|
||||
RaidWiped = true;
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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())
|
||||
{
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
+3
-3
@@ -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);
|
||||
|
||||
|
||||
+2
-2
@@ -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();
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
+1
-1
@@ -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())
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
+1
-1
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
+1
-1
@@ -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())
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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())
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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())
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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())
|
||||
{
|
||||
|
||||
+1
-1
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user