refactor(Core/Misc): enforce east-const style and add codestyle check (#26492)
Co-authored-by: Ludwig <sudlud@users.noreply.github.com>
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#include <chrono>
|
||||
#include <memory>
|
||||
|
||||
void ACSoapThread(const std::string& host, uint16 port)
|
||||
void ACSoapThread(std::string const& host, uint16 port)
|
||||
{
|
||||
struct soap soap;
|
||||
soap_init(&soap);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <memory>
|
||||
|
||||
void process_message(struct soap* soap_message);
|
||||
void ACSoapThread(const std::string& host, uint16 port);
|
||||
void ACSoapThread(std::string const& host, uint16 port);
|
||||
|
||||
class SOAPCommand
|
||||
{
|
||||
|
||||
@@ -120,7 +120,7 @@ std::string RASession::ReadString()
|
||||
return line;
|
||||
}
|
||||
|
||||
bool RASession::CheckAccessLevel(const std::string& user)
|
||||
bool RASession::CheckAccessLevel(std::string const& user)
|
||||
{
|
||||
std::string safeUser = user;
|
||||
|
||||
@@ -152,7 +152,7 @@ bool RASession::CheckAccessLevel(const std::string& user)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RASession::CheckPassword(const std::string& user, const std::string& pass)
|
||||
bool RASession::CheckPassword(std::string const& user, std::string const& pass)
|
||||
{
|
||||
std::string safe_user = user;
|
||||
std::transform(safe_user.begin(), safe_user.end(), safe_user.begin(), ::toupper);
|
||||
|
||||
@@ -38,8 +38,8 @@ public:
|
||||
private:
|
||||
int Send(std::string_view data);
|
||||
std::string ReadString();
|
||||
bool CheckAccessLevel(const std::string& user);
|
||||
bool CheckPassword(const std::string& user, const std::string& pass);
|
||||
bool CheckAccessLevel(std::string const& user);
|
||||
bool CheckPassword(std::string const& user, std::string const& pass);
|
||||
bool ProcessCommand(std::string& command);
|
||||
|
||||
static void CommandPrint(void* callbackArg, std::string_view text);
|
||||
|
||||
@@ -399,7 +399,7 @@ int MySQLConnection::ExecuteTransaction(std::shared_ptr<TransactionBase> transac
|
||||
{
|
||||
stmt = std::get<PreparedStatementBase*>(data.element);
|
||||
}
|
||||
catch (const std::bad_variant_access& ex)
|
||||
catch (std::bad_variant_access const& ex)
|
||||
{
|
||||
LOG_FATAL("sql.sql", "> PreparedStatementBase not found in SQLElementData. {}", ex.what());
|
||||
ABORT();
|
||||
@@ -424,7 +424,7 @@ int MySQLConnection::ExecuteTransaction(std::shared_ptr<TransactionBase> transac
|
||||
{
|
||||
sql = std::get<std::string>(data.element);
|
||||
}
|
||||
catch (const std::bad_variant_access& ex)
|
||||
catch (std::bad_variant_access const& ex)
|
||||
{
|
||||
LOG_FATAL("sql.sql", "> std::string not found in SQLElementData. {}", ex.what());
|
||||
ABORT();
|
||||
@@ -453,7 +453,7 @@ int MySQLConnection::ExecuteTransaction(std::shared_ptr<TransactionBase> transac
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::size_t MySQLConnection::EscapeString(char* to, const char* from, std::size_t length)
|
||||
std::size_t MySQLConnection::EscapeString(char* to, char const* from, std::size_t length)
|
||||
{
|
||||
return mysql_real_escape_string(m_Mysql, to, from, length);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
void RollbackTransaction();
|
||||
void CommitTransaction();
|
||||
int ExecuteTransaction(std::shared_ptr<TransactionBase> transaction);
|
||||
std::size_t EscapeString(char* to, const char* from, std::size_t length);
|
||||
std::size_t EscapeString(char* to, char const* from, std::size_t length);
|
||||
void Ping();
|
||||
|
||||
uint32 GetLastError();
|
||||
|
||||
@@ -39,7 +39,7 @@ struct ResultIterator
|
||||
pointer operator->() { return _ptr; }
|
||||
ResultIterator& operator++() { if (!_ptr->NextRow()) _ptr = nullptr; return *this; }
|
||||
|
||||
bool operator!=(const ResultIterator& right) { return _ptr != right._ptr; }
|
||||
bool operator!=(ResultIterator const& right) { return _ptr != right._ptr; }
|
||||
|
||||
private:
|
||||
pointer _ptr;
|
||||
|
||||
@@ -66,7 +66,7 @@ void TransactionBase::Cleanup()
|
||||
|
||||
delete stmt;
|
||||
}
|
||||
catch (const std::bad_variant_access& ex)
|
||||
catch (std::bad_variant_access const& ex)
|
||||
{
|
||||
LOG_FATAL("sql.sql", "> PreparedStatementBase not found in SQLElementData. {}", ex.what());
|
||||
ABORT();
|
||||
@@ -79,7 +79,7 @@ void TransactionBase::Cleanup()
|
||||
{
|
||||
std::get<std::string>(data.element).clear();
|
||||
}
|
||||
catch (const std::bad_variant_access& ex)
|
||||
catch (std::bad_variant_access const& ex)
|
||||
{
|
||||
LOG_FATAL("sql.sql", "> std::string not found in SQLElementData. {}", ex.what());
|
||||
ABORT();
|
||||
|
||||
@@ -175,7 +175,7 @@ bool DBUpdater<T>::Create(DatabaseWorkerPool<T>& pool)
|
||||
{
|
||||
LOG_WARN("sql.updates", "Database \"{}\" does not exist", pool.GetConnectionInfo()->database);
|
||||
|
||||
const char* disableInteractive = std::getenv("AC_DISABLE_INTERACTIVE");
|
||||
char const* disableInteractive = std::getenv("AC_DISABLE_INTERACTIVE");
|
||||
|
||||
if (!sConfigMgr->isDryRun() && (disableInteractive == nullptr || std::strcmp(disableInteractive, "1") != 0))
|
||||
{
|
||||
@@ -402,7 +402,7 @@ bool DBUpdater<T>::Populate(DatabaseWorkerPool<T>& pool)
|
||||
|
||||
std::vector<std::filesystem::path> sqlFiles;
|
||||
|
||||
for (const auto &entry : std::filesystem::directory_iterator(DirPath))
|
||||
for (auto const& entry : std::filesystem::directory_iterator(DirPath))
|
||||
{
|
||||
if (entry.path().extension() == ".sql")
|
||||
sqlFiles.push_back(entry.path());
|
||||
@@ -410,7 +410,7 @@ bool DBUpdater<T>::Populate(DatabaseWorkerPool<T>& pool)
|
||||
|
||||
std::sort(sqlFiles.begin(), sqlFiles.end());
|
||||
|
||||
for (const auto &file : sqlFiles)
|
||||
for (auto const& file : sqlFiles)
|
||||
{
|
||||
LOG_INFO("sql.updates", ">> Applying \'{}\'...", file.filename().generic_string());
|
||||
|
||||
|
||||
@@ -494,7 +494,7 @@ Unit* PetAI::SelectNextTarget(bool allowAutoSelect) const
|
||||
// Check pet's attackers first to prevent dragging mobs back to owner
|
||||
if (me->HasTauntAura())
|
||||
{
|
||||
const Unit::AuraEffectList& tauntAuras = me->GetAuraEffectsByType(SPELL_AURA_MOD_TAUNT);
|
||||
Unit::AuraEffectList const& tauntAuras = me->GetAuraEffectsByType(SPELL_AURA_MOD_TAUNT);
|
||||
if (!tauntAuras.empty())
|
||||
for (Unit::AuraEffectList::const_reverse_iterator itr = tauntAuras.rbegin(); itr != tauntAuras.rend(); ++itr)
|
||||
if (Unit* caster = (*itr)->GetCaster())
|
||||
|
||||
@@ -625,7 +625,7 @@ void CreatureAI::SetBoundary(CreatureBoundary const* boundary, bool negateBounda
|
||||
me->DoImmediateBoundaryCheck();
|
||||
}
|
||||
|
||||
Creature* CreatureAI::DoSummon(uint32 entry, const Position& pos, uint32 despawnTime, TempSummonType summonType)
|
||||
Creature* CreatureAI::DoSummon(uint32 entry, Position const& pos, uint32 despawnTime, TempSummonType summonType)
|
||||
{
|
||||
return me->SummonCreature(entry, pos, summonType, despawnTime);
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ struct ScriptedAI : public CreatureAI
|
||||
* Hodir is in room until his Y position is below the Door position:
|
||||
* IsInRoom(doorPosition, AXIS_Y, false);
|
||||
*/
|
||||
bool IsInRoom(const Position* pos, Axis axis, bool above)
|
||||
bool IsInRoom(Position const* pos, Axis axis, bool above)
|
||||
{
|
||||
if (!pos)
|
||||
{
|
||||
@@ -389,7 +389,7 @@ struct ScriptedAI : public CreatureAI
|
||||
bool Is25ManRaid() const { return _difficulty & RAID_DIFFICULTY_MASK_25MAN; }
|
||||
|
||||
template<class T> inline
|
||||
const T& DUNGEON_MODE(const T& normal5, const T& heroic10) const
|
||||
T const& DUNGEON_MODE(T const& normal5, T const& heroic10) const
|
||||
{
|
||||
switch (_difficulty)
|
||||
{
|
||||
@@ -405,7 +405,7 @@ struct ScriptedAI : public CreatureAI
|
||||
}
|
||||
|
||||
template<class T> inline
|
||||
const T& RAID_MODE(const T& normal10, const T& normal25) const
|
||||
T const& RAID_MODE(T const& normal10, T const& normal25) const
|
||||
{
|
||||
switch (_difficulty)
|
||||
{
|
||||
@@ -421,7 +421,7 @@ struct ScriptedAI : public CreatureAI
|
||||
}
|
||||
|
||||
template<class T> inline
|
||||
const T& RAID_MODE(const T& normal10, const T& normal25, const T& heroic10, const T& heroic25) const
|
||||
T const& RAID_MODE(T const& normal10, T const& normal25, T const& heroic10, T const& heroic25) const
|
||||
{
|
||||
switch (_difficulty)
|
||||
{
|
||||
|
||||
@@ -257,7 +257,7 @@ void FollowerAI::MovementInform(uint32 motionType, uint32 pointId)
|
||||
}
|
||||
}
|
||||
|
||||
void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Quest* quest, bool inheritWalkState, bool inheritSpeed)
|
||||
void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, Quest const* quest, bool inheritWalkState, bool inheritSpeed)
|
||||
{
|
||||
if (me->GetVictim())
|
||||
{
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
void UpdateAI(uint32) override; //the "internal" update, calls UpdateFollowerAI()
|
||||
virtual void UpdateFollowerAI(uint32); //used when it's needed to add code in update (abilities, scripted events, etc)
|
||||
|
||||
void StartFollow(Player* player, uint32 factionForFollower = 0, const Quest* quest = nullptr, bool inheritWalkState = true, bool inheritSpeed = true);
|
||||
void StartFollow(Player* player, uint32 factionForFollower = 0, Quest const* quest = nullptr, bool inheritWalkState = true, bool inheritSpeed = true);
|
||||
|
||||
void SetFollowPaused(bool bPaused); //if special event require follow mode to hold/resume during the follow
|
||||
void SetFollowComplete(bool bWithEndEvent = false);
|
||||
@@ -75,7 +75,7 @@ private:
|
||||
uint32 m_uiUpdateFollowTimer;
|
||||
uint32 m_uiFollowState;
|
||||
|
||||
const Quest* m_pQuestForFollow; //normally we have a quest
|
||||
Quest const* m_pQuestForFollow; //normally we have a quest
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1151,7 +1151,7 @@ void SmartAI::sGossipSelect(Player* player, uint32 sender, uint32 action)
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_SELECT, player, sender, action);
|
||||
}
|
||||
|
||||
void SmartAI::sGossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/)
|
||||
void SmartAI::sGossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, char const* /*code*/)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1404,7 +1404,7 @@ bool SmartGameObjectAI::GossipSelect(Player* player, uint32 sender, uint32 actio
|
||||
}
|
||||
|
||||
// Called when a player selects a gossip with a code in the gameobject's gossip menu.
|
||||
bool SmartGameObjectAI::GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/)
|
||||
bool SmartGameObjectAI::GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, char const* /*code*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ public:
|
||||
|
||||
void sGossipHello(Player* player) override;
|
||||
void sGossipSelect(Player* player, uint32 sender, uint32 action) override;
|
||||
void sGossipSelectCode(Player* player, uint32 sender, uint32 action, const char* code) override;
|
||||
void sGossipSelectCode(Player* player, uint32 sender, uint32 action, char const* code) override;
|
||||
void sQuestAccept(Player* player, Quest const* quest) override;
|
||||
//void sQuestSelect(Player* player, Quest const* quest);
|
||||
//void sQuestComplete(Player* player, Quest const* quest);
|
||||
@@ -298,7 +298,7 @@ public:
|
||||
|
||||
bool GossipHello(Player* player, bool reportUse) override;
|
||||
bool GossipSelect(Player* player, uint32 sender, uint32 action) override;
|
||||
bool GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/) override;
|
||||
bool GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, char const* /*code*/) override;
|
||||
bool QuestAccept(Player* player, Quest const* quest) override;
|
||||
bool QuestReward(Player* player, Quest const* quest, uint32 opt) override;
|
||||
void Destroyed(Player* player, uint32 eventId) override;
|
||||
|
||||
@@ -1085,7 +1085,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
|
||||
uint32 counter = 0;
|
||||
|
||||
const RewardedQuestSet& rewQuests = GetPlayer()->getRewardedQuests();
|
||||
RewardedQuestSet const& rewQuests = GetPlayer()->getRewardedQuests();
|
||||
for (RewardedQuestSet::const_iterator itr = rewQuests.begin(); itr != rewQuests.end(); ++itr)
|
||||
{
|
||||
Quest const* quest = sObjectMgr->GetQuestTemplate(*itr);
|
||||
@@ -2186,7 +2186,7 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry,
|
||||
sScriptMgr->OnPlayerCriteriaProgress(GetPlayer(), entry);
|
||||
}
|
||||
|
||||
void AchievementMgr::RemoveCriteriaProgress(const AchievementCriteriaEntry* entry)
|
||||
void AchievementMgr::RemoveCriteriaProgress(AchievementCriteriaEntry const* entry)
|
||||
{
|
||||
CriteriaProgressMap::iterator criteriaProgress = _criteriaProgress.find(entry->ID);
|
||||
if (criteriaProgress == _criteriaProgress.end())
|
||||
@@ -2974,7 +2974,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint16 achievementId = fields[0].Get<uint16>();
|
||||
const AchievementEntry* achievement = sAchievementStore.LookupEntry(achievementId);
|
||||
AchievementEntry const* achievement = sAchievementStore.LookupEntry(achievementId);
|
||||
if (!achievement)
|
||||
{
|
||||
// Remove non existent achievements from all characters
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace AddonMgr
|
||||
m_knownAddons.emplace_back(addon.Name, addon.CRC);
|
||||
}
|
||||
|
||||
SavedAddon const* GetAddonInfo(const std::string& name)
|
||||
SavedAddon const* GetAddonInfo(std::string const& name)
|
||||
{
|
||||
for (auto const& addon : m_knownAddons)
|
||||
{
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace AddonMgr
|
||||
{
|
||||
void LoadFromDB();
|
||||
void SaveAddon(AddonInfo const& addon);
|
||||
SavedAddon const* GetAddonInfo(const std::string& name);
|
||||
SavedAddon const* GetAddonInfo(std::string const& name);
|
||||
|
||||
typedef std::list<BannedAddon> BannedAddonList;
|
||||
BannedAddonList const* GetBannedAddons();
|
||||
|
||||
@@ -113,7 +113,7 @@ bool ArenaSpectator::HandleSpectatorSpectateCommand(ChatHandler* handler, std::s
|
||||
if (!player->m_Controlled.empty())
|
||||
errors.push_back("Can't be controlling creatures.");
|
||||
|
||||
const Unit::VisibleAuraMap* va = player->GetVisibleAuras();
|
||||
Unit::VisibleAuraMap const* va = player->GetVisibleAuras();
|
||||
for (auto itr = va->begin(); itr != va->end(); ++itr)
|
||||
if (Aura* aura = itr->second->GetBase())
|
||||
if (!itr->second->IsPositive() && !aura->IsPermanent() && aura->GetDuration() < HOUR * IN_MILLISECONDS)
|
||||
@@ -310,7 +310,7 @@ AC_GAME_API void ArenaSpectator::SendPacketTo(Player const* player, std::string&
|
||||
}
|
||||
|
||||
template<>
|
||||
AC_GAME_API void ArenaSpectator::SendPacketTo(const Map* map, std::string&& message)
|
||||
AC_GAME_API void ArenaSpectator::SendPacketTo(Map const* map, std::string&& message)
|
||||
{
|
||||
if (!map->IsBattleArena())
|
||||
return;
|
||||
|
||||
@@ -41,7 +41,7 @@ class WorldPacket;
|
||||
namespace ArenaSpectator
|
||||
{
|
||||
template<class T>
|
||||
AC_GAME_API void SendPacketTo(const T* object, std::string&& message);
|
||||
AC_GAME_API void SendPacketTo(T const* object, std::string&& message);
|
||||
|
||||
template<class T, typename Format, typename... Args>
|
||||
inline void SendCommand(T* o, Format&& fmt, Args&& ... args)
|
||||
@@ -50,7 +50,7 @@ namespace ArenaSpectator
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline void SendCommand_String(T* o, ObjectGuid targetGUID, const char* prefix, const char* c)
|
||||
inline void SendCommand_String(T* o, ObjectGuid targetGUID, char const* prefix, char const* c)
|
||||
{
|
||||
if (!targetGUID.IsPlayer())
|
||||
return;
|
||||
@@ -59,7 +59,7 @@ namespace ArenaSpectator
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline void SendCommand_UInt32Value(T* o, ObjectGuid targetGUID, const char* prefix, uint32 t)
|
||||
inline void SendCommand_UInt32Value(T* o, ObjectGuid targetGUID, char const* prefix, uint32 t)
|
||||
{
|
||||
if (!targetGUID.IsPlayer())
|
||||
return;
|
||||
@@ -68,7 +68,7 @@ namespace ArenaSpectator
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline void SendCommand_GUID(T* o, ObjectGuid targetGUID, const char* prefix, ObjectGuid t)
|
||||
inline void SendCommand_GUID(T* o, ObjectGuid targetGUID, char const* prefix, ObjectGuid t)
|
||||
{
|
||||
if (!targetGUID.IsPlayer())
|
||||
return;
|
||||
@@ -77,7 +77,7 @@ namespace ArenaSpectator
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline void SendCommand_Spell(T* o, ObjectGuid targetGUID, const char* prefix, uint32 id, int32 casttime)
|
||||
inline void SendCommand_Spell(T* o, ObjectGuid targetGUID, char const* prefix, uint32 id, int32 casttime)
|
||||
{
|
||||
if (!targetGUID.IsPlayer())
|
||||
return;
|
||||
@@ -86,7 +86,7 @@ namespace ArenaSpectator
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline void SendCommand_Cooldown(T* o, ObjectGuid targetGUID, const char* prefix, uint32 id, uint32 dur, uint32 maxdur)
|
||||
inline void SendCommand_Cooldown(T* o, ObjectGuid targetGUID, char const* prefix, uint32 id, uint32 dur, uint32 maxdur)
|
||||
{
|
||||
if (!targetGUID.IsPlayer())
|
||||
return;
|
||||
@@ -99,7 +99,7 @@ namespace ArenaSpectator
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline void SendCommand_Aura(T* o, ObjectGuid targetGUID, const char* prefix, ObjectGuid caster, uint32 id, bool isDebuff, uint32 dispel, int32 dur, int32 maxdur, uint32 stack, bool remove)
|
||||
inline void SendCommand_Aura(T* o, ObjectGuid targetGUID, char const* prefix, ObjectGuid caster, uint32 id, bool isDebuff, uint32 dispel, int32 dur, int32 maxdur, uint32 stack, bool remove)
|
||||
{
|
||||
if (!targetGUID.IsPlayer())
|
||||
return;
|
||||
|
||||
@@ -52,7 +52,7 @@ struct ArenaSeasonReward
|
||||
ArenaSeasonRewardType type{ARENA_SEASON_REWARD_TYPE_ITEM};
|
||||
|
||||
// Used in unit tests.
|
||||
bool operator==(const ArenaSeasonReward& other) const
|
||||
bool operator==(ArenaSeasonReward const& other) const
|
||||
{
|
||||
return entry == other.entry && type == other.type;
|
||||
}
|
||||
@@ -78,7 +78,7 @@ struct ArenaSeasonRewardGroup
|
||||
std::vector<ArenaSeasonReward> achievementRewards;
|
||||
|
||||
// Used in unit tests.
|
||||
bool operator==(const ArenaSeasonRewardGroup& other) const
|
||||
bool operator==(ArenaSeasonRewardGroup const& other) const
|
||||
{
|
||||
return minCriteria == other.minCriteria &&
|
||||
maxCriteria == other.maxCriteria &&
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
constexpr float minPctTeamGamesForMemberToGetReward = 30;
|
||||
|
||||
void ArenaSeasonTeamRewarderImpl::RewardTeamWithRewardGroup(ArenaTeam *arenaTeam, const ArenaSeasonRewardGroup &rewardGroup)
|
||||
void ArenaSeasonTeamRewarderImpl::RewardTeamWithRewardGroup(ArenaTeam *arenaTeam, ArenaSeasonRewardGroup const& rewardGroup)
|
||||
{
|
||||
RewardWithMail(arenaTeam, rewardGroup);
|
||||
RewardWithAchievements(arenaTeam, rewardGroup);
|
||||
|
||||
@@ -778,7 +778,7 @@ int32 ArenaTeam::GetRatingMod(uint32 ownRating, uint32 opponentRating, bool won
|
||||
return (int32)ceil(mod);
|
||||
}
|
||||
|
||||
void ArenaTeam::FinishGame(int32 mod, const Map* bgMap)
|
||||
void ArenaTeam::FinishGame(int32 mod, Map const* bgMap)
|
||||
{
|
||||
// Rating can only drop to 0
|
||||
if (int32(Stats.Rating) + mod < 0)
|
||||
@@ -808,7 +808,7 @@ void ArenaTeam::FinishGame(int32 mod, const Map* bgMap)
|
||||
}
|
||||
}
|
||||
|
||||
int32 ArenaTeam::WonAgainst(uint32 Own_MMRating, uint32 Opponent_MMRating, int32& rating_change, const Map* bgMap)
|
||||
int32 ArenaTeam::WonAgainst(uint32 Own_MMRating, uint32 Opponent_MMRating, int32& rating_change, Map const* bgMap)
|
||||
{
|
||||
// Called when the team has won
|
||||
// Change in Matchmaker rating
|
||||
@@ -828,7 +828,7 @@ int32 ArenaTeam::WonAgainst(uint32 Own_MMRating, uint32 Opponent_MMRating, int32
|
||||
return mod;
|
||||
}
|
||||
|
||||
int32 ArenaTeam::LostAgainst(uint32 Own_MMRating, uint32 Opponent_MMRating, int32& rating_change, const Map* bgMap)
|
||||
int32 ArenaTeam::LostAgainst(uint32 Own_MMRating, uint32 Opponent_MMRating, int32& rating_change, Map const* bgMap)
|
||||
{
|
||||
// Called when the team has lost
|
||||
// Change in Matchmaker Rating
|
||||
@@ -1013,7 +1013,7 @@ bool ArenaTeam::IsFighting() const
|
||||
return false;
|
||||
}
|
||||
|
||||
ArenaTeamMember* ArenaTeam::GetMember(const std::string& name)
|
||||
ArenaTeamMember* ArenaTeam::GetMember(std::string const& name)
|
||||
{
|
||||
return GetMember(sCharacterCache->GetCharacterGuidByName(name));
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
static uint8 GetReqPlayersForType(uint32 type);
|
||||
[[nodiscard]] ObjectGuid GetCaptain() const { return CaptainGuid; }
|
||||
[[nodiscard]] std::string const& GetName() const { return TeamName; }
|
||||
[[nodiscard]] const ArenaTeamStats& GetStats() const { return Stats; }
|
||||
[[nodiscard]] ArenaTeamStats const& GetStats() const { return Stats; }
|
||||
void SetArenaTeamStats(ArenaTeamStats& stats) { Stats = stats; }
|
||||
|
||||
[[nodiscard]] uint32 GetRating() const { return Stats.Rating; }
|
||||
@@ -198,15 +198,15 @@ public:
|
||||
int32 GetMatchmakerRatingMod(uint32 ownRating, uint32 opponentRating, bool won);
|
||||
int32 GetRatingMod(uint32 ownRating, uint32 opponentRating, bool won);
|
||||
float GetChanceAgainst(uint32 ownRating, uint32 opponentRating);
|
||||
int32 WonAgainst(uint32 Own_MMRating, uint32 Opponent_MMRating, int32& rating_change, const Map* bgMap);
|
||||
int32 WonAgainst(uint32 Own_MMRating, uint32 Opponent_MMRating, int32& rating_change, Map const* bgMap);
|
||||
void MemberWon(Player* player, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange);
|
||||
int32 LostAgainst(uint32 Own_MMRating, uint32 Opponent_MMRating, int32& rating_change, const Map* bgMap);
|
||||
int32 LostAgainst(uint32 Own_MMRating, uint32 Opponent_MMRating, int32& rating_change, Map const* bgMap);
|
||||
void MemberLost(Player* player, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange = -12);
|
||||
|
||||
void UpdateArenaPointsHelper(std::map<ObjectGuid, uint32>& PlayerPoints);
|
||||
|
||||
bool FinishWeek(); // returns true if arena team played this week
|
||||
void FinishGame(int32 mod, const Map* bgMap);
|
||||
void FinishGame(int32 mod, Map const* bgMap);
|
||||
|
||||
void SetPreviousOpponents(uint32 arenaTeamId) { PreviousOpponents = arenaTeamId; }
|
||||
uint32 GetPreviousOpponents() { return PreviousOpponents; }
|
||||
|
||||
@@ -55,7 +55,7 @@ ArenaTeam* ArenaTeamMgr::GetArenaTeamById(uint32 arenaTeamId) const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ArenaTeam* ArenaTeamMgr::GetArenaTeamByName(const std::string& arenaTeamName) const
|
||||
ArenaTeam* ArenaTeamMgr::GetArenaTeamByName(std::string const& arenaTeamName) const
|
||||
{
|
||||
std::string search = arenaTeamName;
|
||||
std::transform(search.begin(), search.end(), search.begin(), ::toupper);
|
||||
|
||||
@@ -404,7 +404,7 @@ public:
|
||||
void AddSpectator(Player* p) { m_Spectators.insert(p); }
|
||||
void RemoveSpectator(Player* p) { m_Spectators.erase(p); }
|
||||
bool HaveSpectators() { return !m_Spectators.empty(); }
|
||||
[[nodiscard]] const SpectatorList& GetSpectators() const { return m_Spectators; }
|
||||
[[nodiscard]] SpectatorList const& GetSpectators() const { return m_Spectators; }
|
||||
void AddToBeTeleported(ObjectGuid spectator, ObjectGuid participant) { m_ToBeTeleported[spectator] = participant; }
|
||||
void RemoveToBeTeleported(ObjectGuid spectator) { ToBeTeleportedMap::iterator itr = m_ToBeTeleported.find(spectator); if (itr != m_ToBeTeleported.end()) m_ToBeTeleported.erase(itr); }
|
||||
void SpectatorsSendPacket(WorldPacket& data);
|
||||
@@ -456,7 +456,7 @@ public:
|
||||
virtual void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& /*packet*/) { }
|
||||
void SendPacketToTeam(TeamId teamId, WorldPacket const* packet, Player* sender = nullptr, bool self = true);
|
||||
void SendPacketToAll(WorldPacket const* packet);
|
||||
void YellToAll(Creature* creature, const char* text, uint32 language);
|
||||
void YellToAll(Creature* creature, char const* text, uint32 language);
|
||||
|
||||
void SendChatMessage(Creature* source, uint8 textId, WorldObject* target = nullptr);
|
||||
void SendBroadcastText(uint32 id, ChatMsg msgType, WorldObject const* target = nullptr);
|
||||
@@ -576,37 +576,37 @@ public:
|
||||
[[nodiscard]] uint8 GetUniqueBracketId() const;
|
||||
|
||||
BattlegroundAV* ToBattlegroundAV() { if (GetBgTypeID(true) == BATTLEGROUND_AV) return reinterpret_cast<BattlegroundAV*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundAV const* ToBattlegroundAV() const { if (GetBgTypeID(true) == BATTLEGROUND_AV) return reinterpret_cast<const BattlegroundAV*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundAV const* ToBattlegroundAV() const { if (GetBgTypeID(true) == BATTLEGROUND_AV) return reinterpret_cast<BattlegroundAV const*>(this); else return nullptr; }
|
||||
|
||||
BattlegroundWS* ToBattlegroundWS() { if (GetBgTypeID(true) == BATTLEGROUND_WS) return reinterpret_cast<BattlegroundWS*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundWS const* ToBattlegroundWS() const { if (GetBgTypeID(true) == BATTLEGROUND_WS) return reinterpret_cast<const BattlegroundWS*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundWS const* ToBattlegroundWS() const { if (GetBgTypeID(true) == BATTLEGROUND_WS) return reinterpret_cast<BattlegroundWS const*>(this); else return nullptr; }
|
||||
|
||||
BattlegroundAB* ToBattlegroundAB() { if (GetBgTypeID(true) == BATTLEGROUND_AB) return reinterpret_cast<BattlegroundAB*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundAB const* ToBattlegroundAB() const { if (GetBgTypeID(true) == BATTLEGROUND_AB) return reinterpret_cast<const BattlegroundAB*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundAB const* ToBattlegroundAB() const { if (GetBgTypeID(true) == BATTLEGROUND_AB) return reinterpret_cast<BattlegroundAB const*>(this); else return nullptr; }
|
||||
|
||||
BattlegroundNA* ToBattlegroundNA() { if (GetBgTypeID(true) == BATTLEGROUND_NA) return reinterpret_cast<BattlegroundNA*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundNA const* ToBattlegroundNA() const { if (GetBgTypeID(true) == BATTLEGROUND_NA) return reinterpret_cast<const BattlegroundNA*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundNA const* ToBattlegroundNA() const { if (GetBgTypeID(true) == BATTLEGROUND_NA) return reinterpret_cast<BattlegroundNA const*>(this); else return nullptr; }
|
||||
|
||||
BattlegroundBE* ToBattlegroundBE() { if (GetBgTypeID(true) == BATTLEGROUND_BE) return reinterpret_cast<BattlegroundBE*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundBE const* ToBattlegroundBE() const { if (GetBgTypeID(true) == BATTLEGROUND_BE) return reinterpret_cast<const BattlegroundBE*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundBE const* ToBattlegroundBE() const { if (GetBgTypeID(true) == BATTLEGROUND_BE) return reinterpret_cast<BattlegroundBE const*>(this); else return nullptr; }
|
||||
|
||||
BattlegroundEY* ToBattlegroundEY() { if (GetBgTypeID(true) == BATTLEGROUND_EY) return reinterpret_cast<BattlegroundEY*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundEY const* ToBattlegroundEY() const { if (GetBgTypeID(true) == BATTLEGROUND_EY) return reinterpret_cast<const BattlegroundEY*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundEY const* ToBattlegroundEY() const { if (GetBgTypeID(true) == BATTLEGROUND_EY) return reinterpret_cast<BattlegroundEY const*>(this); else return nullptr; }
|
||||
|
||||
BattlegroundRL* ToBattlegroundRL() { if (GetBgTypeID(true) == BATTLEGROUND_RL) return reinterpret_cast<BattlegroundRL*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundRL const* ToBattlegroundRL() const { if (GetBgTypeID(true) == BATTLEGROUND_RL) return reinterpret_cast<const BattlegroundRL*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundRL const* ToBattlegroundRL() const { if (GetBgTypeID(true) == BATTLEGROUND_RL) return reinterpret_cast<BattlegroundRL const*>(this); else return nullptr; }
|
||||
|
||||
BattlegroundSA* ToBattlegroundSA() { if (GetBgTypeID(true) == BATTLEGROUND_SA) return reinterpret_cast<BattlegroundSA*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundSA const* ToBattlegroundSA() const { if (GetBgTypeID(true) == BATTLEGROUND_SA) return reinterpret_cast<const BattlegroundSA*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundSA const* ToBattlegroundSA() const { if (GetBgTypeID(true) == BATTLEGROUND_SA) return reinterpret_cast<BattlegroundSA const*>(this); else return nullptr; }
|
||||
|
||||
BattlegroundDS* ToBattlegroundDS() { if (GetBgTypeID(true) == BATTLEGROUND_DS) return reinterpret_cast<BattlegroundDS*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundDS const* ToBattlegroundDS() const { if (GetBgTypeID(true) == BATTLEGROUND_DS) return reinterpret_cast<const BattlegroundDS*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundDS const* ToBattlegroundDS() const { if (GetBgTypeID(true) == BATTLEGROUND_DS) return reinterpret_cast<BattlegroundDS const*>(this); else return nullptr; }
|
||||
|
||||
BattlegroundRV* ToBattlegroundRV() { if (GetBgTypeID(true) == BATTLEGROUND_RV) return reinterpret_cast<BattlegroundRV*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundRV const* ToBattlegroundRV() const { if (GetBgTypeID(true) == BATTLEGROUND_RV) return reinterpret_cast<const BattlegroundRV*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundRV const* ToBattlegroundRV() const { if (GetBgTypeID(true) == BATTLEGROUND_RV) return reinterpret_cast<BattlegroundRV const*>(this); else return nullptr; }
|
||||
|
||||
BattlegroundIC* ToBattlegroundIC() { if (GetBgTypeID(true) == BATTLEGROUND_IC) return reinterpret_cast<BattlegroundIC*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundIC const* ToBattlegroundIC() const { if (GetBgTypeID(true) == BATTLEGROUND_IC) return reinterpret_cast<const BattlegroundIC*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundIC const* ToBattlegroundIC() const { if (GetBgTypeID(true) == BATTLEGROUND_IC) return reinterpret_cast<BattlegroundIC const*>(this); else return nullptr; }
|
||||
|
||||
protected:
|
||||
// this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends Battleground
|
||||
|
||||
@@ -343,7 +343,7 @@ std::vector<Battleground const*> BattlegroundMgr::GetActiveBattlegrounds()
|
||||
for (auto const& [bgType, bgData] : bgDataStore)
|
||||
for (auto const& [id, bg] : bgData._Battlegrounds)
|
||||
if (bg->GetStatus() == STATUS_WAIT_JOIN || bg->GetStatus() == STATUS_IN_PROGRESS)
|
||||
result.push_back(static_cast<const Battleground*>(bg));
|
||||
result.push_back(static_cast<Battleground const*>(bg));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ void BattlegroundEY::UpdatePointsState()
|
||||
_capturePointInfo[point]._playersCount[TEAM_HORDE] = 0;
|
||||
}
|
||||
|
||||
const BattlegroundPlayerMap& bgPlayerMap = GetPlayers();
|
||||
BattlegroundPlayerMap const& bgPlayerMap = GetPlayers();
|
||||
for (BattlegroundPlayerMap::const_iterator itr = bgPlayerMap.begin(); itr != bgPlayerMap.end(); ++itr)
|
||||
{
|
||||
itr->second->SendUpdateWorldState(WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_SHOW, BG_EY_PROGRESS_BAR_DONT_SHOW);
|
||||
|
||||
@@ -171,7 +171,7 @@ public:
|
||||
void SetStatusTime(time_t statusTime) { _statusTime = statusTime; }
|
||||
time_t GetStatusTime() const { return _statusTime; }
|
||||
|
||||
void SetText(const std::string& text) { _text = text; }
|
||||
void SetText(std::string const& text) { _text = text; }
|
||||
std::string GetText() const { return _text; }
|
||||
|
||||
void SetStatus(CalendarInviteStatus status) { _status = status; }
|
||||
@@ -228,10 +228,10 @@ public:
|
||||
void SetGuildId(uint32 guildId) { _guildId = guildId; }
|
||||
uint32 GetGuildId() const { return _guildId; }
|
||||
|
||||
void SetTitle(const std::string& title) { _title = title; }
|
||||
void SetTitle(std::string const& title) { _title = title; }
|
||||
std::string GetTitle() const { return _title; }
|
||||
|
||||
void SetDescription(const std::string& description) { _description = description; }
|
||||
void SetDescription(std::string const& description) { _description = description; }
|
||||
std::string GetDescription() const { return _description; }
|
||||
|
||||
void SetType(CalendarEventType type) { _type = type; }
|
||||
|
||||
@@ -1083,7 +1083,7 @@ void Channel::MakePlayerUnbanned(WorldPacket* data, ObjectGuid bad, ObjectGuid g
|
||||
*data << good;
|
||||
}
|
||||
|
||||
void Channel::MakePlayerNotBanned(WorldPacket* data, const std::string& name)
|
||||
void Channel::MakePlayerNotBanned(WorldPacket* data, std::string const& name)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_PLAYER_NOT_BANNED_NOTICE);
|
||||
*data << name;
|
||||
@@ -1121,13 +1121,13 @@ void Channel::MakeNotModerated(WorldPacket* data)
|
||||
MakeNotifyPacket(data, CHAT_NOT_MODERATED_NOTICE);
|
||||
}
|
||||
|
||||
void Channel::MakePlayerInvited(WorldPacket* data, const std::string& name)
|
||||
void Channel::MakePlayerInvited(WorldPacket* data, std::string const& name)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_PLAYER_INVITED_NOTICE);
|
||||
*data << name;
|
||||
}
|
||||
|
||||
void Channel::MakePlayerInviteBanned(WorldPacket* data, const std::string& name)
|
||||
void Channel::MakePlayerInviteBanned(WorldPacket* data, std::string const& name)
|
||||
{
|
||||
MakeNotifyPacket(data, CHAT_PLAYER_INVITE_BANNED_NOTICE);
|
||||
*data << name;
|
||||
|
||||
@@ -119,7 +119,7 @@ class ChannelRights
|
||||
{
|
||||
public:
|
||||
ChannelRights() = default;
|
||||
ChannelRights(const uint32& f, const uint32& d, std::string jm, std::string sm, std::set<uint32> ml) : flags(f), speakDelay(d), joinMessage(std::move(jm)), speakMessage(std::move(sm)), moderators(std::move(ml)) {}
|
||||
ChannelRights(uint32 const& f, uint32 const& d, std::string jm, std::string sm, std::set<uint32> ml) : flags(f), speakDelay(d), joinMessage(std::move(jm)), speakMessage(std::move(sm)), moderators(std::move(ml)) {}
|
||||
uint32 flags{0};
|
||||
uint32 speakDelay{0};
|
||||
std::string joinMessage;
|
||||
|
||||
@@ -205,7 +205,7 @@ void ChannelMgr::LoadChannelRights()
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
const ChannelRights& ChannelMgr::GetChannelRightsFor(const std::string& name)
|
||||
ChannelRights const& ChannelMgr::GetChannelRightsFor(std::string const& name)
|
||||
{
|
||||
std::string nameStr = name;
|
||||
std::transform(nameStr.begin(), nameStr.end(), nameStr.begin(), ::tolower);
|
||||
@@ -215,7 +215,7 @@ const ChannelRights& ChannelMgr::GetChannelRightsFor(const std::string& name)
|
||||
return channelRightsEmpty;
|
||||
}
|
||||
|
||||
void ChannelMgr::SetChannelRightsFor(const std::string& name, const uint32& flags, const uint32& speakDelay, const std::string& joinmessage, const std::string& speakmessage, const std::set<uint32>& moderators)
|
||||
void ChannelMgr::SetChannelRightsFor(std::string const& name, uint32 const& flags, uint32 const& speakDelay, std::string const& joinmessage, std::string const& speakmessage, std::set<uint32> const& moderators)
|
||||
{
|
||||
std::string nameStr = name;
|
||||
std::transform(nameStr.begin(), nameStr.end(), nameStr.begin(), ::tolower);
|
||||
|
||||
@@ -43,8 +43,8 @@ public:
|
||||
static void LoadChannels();
|
||||
|
||||
static void LoadChannelRights();
|
||||
static const ChannelRights& GetChannelRightsFor(const std::string& name);
|
||||
static void SetChannelRightsFor(const std::string& name, const uint32& flags, const uint32& speakDelay, const std::string& joinmessage, const std::string& speakmessage, const std::set<uint32>& moderators);
|
||||
static ChannelRights const& GetChannelRightsFor(std::string const& name);
|
||||
static void SetChannelRightsFor(std::string const& name, uint32 const& flags, uint32 const& speakDelay, std::string const& joinmessage, std::string const& speakmessage, std::set<uint32> const& moderators);
|
||||
static uint32 _channelIdMax;
|
||||
|
||||
private:
|
||||
|
||||
@@ -191,7 +191,7 @@ void ChatHandler::SendSysMessage(std::string_view str, bool escapeCharacters)
|
||||
}
|
||||
}
|
||||
|
||||
void ChatHandler::SendGlobalSysMessage(const char* str)
|
||||
void ChatHandler::SendGlobalSysMessage(char const* str)
|
||||
{
|
||||
WorldPacket data;
|
||||
for (std::string_view line : Acore::Tokenize(str, '\n', true))
|
||||
@@ -201,7 +201,7 @@ void ChatHandler::SendGlobalSysMessage(const char* str)
|
||||
}
|
||||
}
|
||||
|
||||
void ChatHandler::SendGlobalGMSysMessage(const char* str)
|
||||
void ChatHandler::SendGlobalGMSysMessage(char const* str)
|
||||
{
|
||||
WorldPacket data;
|
||||
for (std::string_view line : Acore::Tokenize(str, '\n', true))
|
||||
@@ -928,7 +928,7 @@ bool CliHandler::needReportToTarget(Player* /*chr*/) const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::GetPlayerGroupAndGUIDByName(const char* cname, Player*& player, Group*& group, ObjectGuid& guid, bool offline)
|
||||
bool ChatHandler::GetPlayerGroupAndGUIDByName(char const* cname, Player*& player, Group*& group, ObjectGuid& guid, bool offline)
|
||||
{
|
||||
player = nullptr;
|
||||
guid = ObjectGuid::Empty;
|
||||
|
||||
@@ -191,7 +191,7 @@ public:
|
||||
bool _ParseCommands(std::string_view text);
|
||||
virtual bool ParseCommands(std::string_view text);
|
||||
|
||||
void SendGlobalSysMessage(const char* str);
|
||||
void SendGlobalSysMessage(char const* str);
|
||||
|
||||
// function with different implementation for chat/console
|
||||
virtual bool IsHumanReadable() const { return true; }
|
||||
@@ -203,7 +203,7 @@ public:
|
||||
bool HasLowerSecurity(Player* target, ObjectGuid guid = ObjectGuid::Empty, bool strong = false);
|
||||
bool HasLowerSecurityAccount(WorldSession* target, uint32 account, bool strong = false);
|
||||
|
||||
void SendGlobalGMSysMessage(const char* str);
|
||||
void SendGlobalGMSysMessage(char const* str);
|
||||
Player* getSelectedPlayer() const;
|
||||
Creature* getSelectedCreature() const;
|
||||
Unit* getSelectedUnit() const;
|
||||
@@ -223,7 +223,7 @@ public:
|
||||
|
||||
uint32 extractSpellIdFromLink(char* text);
|
||||
ObjectGuid::LowType extractLowGuidFromLink(char* text, HighGuid& guidHigh);
|
||||
bool GetPlayerGroupAndGUIDByName(const char* cname, Player*& player, Group*& group, ObjectGuid& guid, bool offline = false);
|
||||
bool GetPlayerGroupAndGUIDByName(char const* cname, Player*& player, Group*& group, ObjectGuid& guid, bool offline = false);
|
||||
std::string extractPlayerNameFromLink(char* text);
|
||||
// select by arg (name/link) or in-game selection online/offline player
|
||||
bool extractPlayerTarget(char* args, Player** player, ObjectGuid* player_guid = nullptr, std::string* player_name = nullptr);
|
||||
|
||||
@@ -217,7 +217,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
|
||||
if (Player* player = unit->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
{
|
||||
// Xinef: cannot be null, checked at loading
|
||||
const Quest* quest = sObjectMgr->GetQuestTemplate(ConditionValue1);
|
||||
Quest const* quest = sObjectMgr->GetQuestTemplate(ConditionValue1);
|
||||
condMeets = !player->IsQuestRewarded(ConditionValue1) && player->SatisfyQuestExclusiveGroup(quest, false);
|
||||
}
|
||||
}
|
||||
@@ -1083,7 +1083,7 @@ ConditionList ConditionMgr::GetConditionsForNpcVendorEvent(uint32 creatureId, ui
|
||||
return cond;
|
||||
}
|
||||
|
||||
ConditionList ConditionMgr::GetConditionsForObjectVisibility(const WorldObject* object) const
|
||||
ConditionList ConditionMgr::GetConditionsForObjectVisibility(WorldObject const* object) const
|
||||
{
|
||||
ConditionList cond;
|
||||
|
||||
@@ -1199,7 +1199,7 @@ void ConditionMgr::LoadConditions(bool isReload)
|
||||
}
|
||||
cond->ReferenceId = uint32(std::abs(iConditionTypeOrReference));
|
||||
|
||||
const char* rowType = "reference template";
|
||||
char const* rowType = "reference template";
|
||||
if (iSourceTypeOrReferenceId >= 0)
|
||||
rowType = "reference";
|
||||
// check for useless data
|
||||
@@ -2546,7 +2546,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
||||
}
|
||||
case CONDITION_QUEST_OBJECTIVE_PROGRESS:
|
||||
{
|
||||
const Quest* quest = sObjectMgr->GetQuestTemplate(cond->ConditionValue1);
|
||||
Quest const* quest = sObjectMgr->GetQuestTemplate(cond->ConditionValue1);
|
||||
if (!quest)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "CONDITION_QUEST_OBJECTIVE_PROGRESS points to non-existing quest ({}), skipped.", cond->ConditionValue1);
|
||||
|
||||
@@ -271,7 +271,7 @@ public:
|
||||
ConditionList GetConditionsForSmartEvent(int32 entryOrGuid, uint32 eventId, uint32 sourceType);
|
||||
ConditionList GetConditionsForVehicleSpell(uint32 creatureId, uint32 spellId);
|
||||
ConditionList GetConditionsForNpcVendorEvent(uint32 creatureId, uint32 itemId);
|
||||
ConditionList GetConditionsForObjectVisibility(const WorldObject* object) const;
|
||||
ConditionList GetConditionsForObjectVisibility(WorldObject const* object) const;
|
||||
|
||||
private:
|
||||
bool isSourceTypeValid(Condition* cond);
|
||||
|
||||
@@ -201,7 +201,7 @@ typedef std::list<std::string> StoreProblemList;
|
||||
|
||||
uint32 DBCFileCount = 0;
|
||||
|
||||
static bool LoadDBC_assert_print(uint32 fsize, uint32 rsize, const std::string& filename)
|
||||
static bool LoadDBC_assert_print(uint32 fsize, uint32 rsize, std::string const& filename)
|
||||
{
|
||||
LOG_ERROR("dbc", "Size of '{}' set by format string ({}) not equal size of C++ structure ({}).", filename, fsize, rsize);
|
||||
|
||||
@@ -258,7 +258,7 @@ inline void LoadDBC(uint32& availableDbcLocales, StoreProblemList& errors, DBCSt
|
||||
}
|
||||
}
|
||||
|
||||
void LoadDBCStores(const std::string& dataPath)
|
||||
void LoadDBCStores(std::string const& dataPath)
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
@@ -913,7 +913,7 @@ SkillRaceClassInfoEntry const* GetSkillRaceClassInfo(uint32 skill, uint8 race, u
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const std::vector<SkillLineAbilityEntry const*>& GetSkillLineAbilitiesBySkillLine(uint32 skillLine)
|
||||
std::vector<SkillLineAbilityEntry const*> const& GetSkillLineAbilitiesBySkillLine(uint32 skillLine)
|
||||
{
|
||||
auto it = sSkillLineAbilityIndexBySkillLine.find(skillLine);
|
||||
if (it == sSkillLineAbilityIndexBySkillLine.end())
|
||||
|
||||
@@ -73,7 +73,7 @@ typedef std::pair<SkillRaceClassInfoMap::iterator, SkillRaceClassInfoMap::iterat
|
||||
SkillRaceClassInfoEntry const* GetSkillRaceClassInfo(uint32 skill, uint8 race, uint8 class_);
|
||||
|
||||
typedef std::unordered_map<uint32 /* SkillLine */, std::vector<SkillLineAbilityEntry const*> > SkillLineAbilityIndexBySkillLine;
|
||||
const std::vector<SkillLineAbilityEntry const*>& GetSkillLineAbilitiesBySkillLine(uint32 skillLine);
|
||||
std::vector<SkillLineAbilityEntry const*> const& GetSkillLineAbilitiesBySkillLine(uint32 skillLine);
|
||||
|
||||
extern DBCStorage <AchievementEntry> sAchievementStore;
|
||||
extern DBCStorage <AchievementCriteriaEntry> sAchievementCriteriaStore;
|
||||
@@ -194,6 +194,6 @@ extern DBCStorage <WMOAreaTableEntry> sWMOAreaTableStore;
|
||||
//extern DBCStorage <WorldMapAreaEntry> sWorldMapAreaStore; -- use Zone2MapCoordinates and Map2ZoneCoordinates
|
||||
extern DBCStorage <WorldMapOverlayEntry> sWorldMapOverlayStore;
|
||||
|
||||
void LoadDBCStores(const std::string& dataPath);
|
||||
void LoadDBCStores(std::string const& dataPath);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -182,7 +182,7 @@ namespace lfg
|
||||
return 0;
|
||||
}
|
||||
|
||||
void insert(const ObjectGuid& g)
|
||||
void insert(ObjectGuid const& g)
|
||||
{
|
||||
// avoid loops for performance
|
||||
if (!guids[0])
|
||||
@@ -273,7 +273,7 @@ namespace lfg
|
||||
guids[4] = g;
|
||||
}
|
||||
|
||||
void force_insert_front(const ObjectGuid& g)
|
||||
void force_insert_front(ObjectGuid const& g)
|
||||
{
|
||||
if (guids[3])
|
||||
{
|
||||
@@ -294,7 +294,7 @@ namespace lfg
|
||||
guids[0] = g;
|
||||
}
|
||||
|
||||
void remove(const ObjectGuid& g)
|
||||
void remove(ObjectGuid const& g)
|
||||
{
|
||||
// avoid loops for performance
|
||||
if (guids[0] == g)
|
||||
@@ -427,12 +427,12 @@ namespace lfg
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] bool hasGuid(const ObjectGuid& g) const
|
||||
[[nodiscard]] bool hasGuid(ObjectGuid const& g) const
|
||||
{
|
||||
return g && (guids[0] == g || guids[1] == g || guids[2] == g || guids[3] == g || guids[4] == g);
|
||||
}
|
||||
|
||||
bool operator<(const Lfg5Guids& x) const
|
||||
bool operator<(Lfg5Guids const& x) const
|
||||
{
|
||||
if (guids[0] <= x.guids[0])
|
||||
{
|
||||
@@ -474,12 +474,12 @@ namespace lfg
|
||||
return false;
|
||||
}
|
||||
|
||||
bool operator==(const Lfg5Guids& x) const
|
||||
bool operator==(Lfg5Guids const& x) const
|
||||
{
|
||||
return guids[0] == x.guids[0] && guids[1] == x.guids[1] && guids[2] == x.guids[2] && guids[3] == x.guids[3] && guids[4] == x.guids[4];
|
||||
}
|
||||
|
||||
void operator=(const Lfg5Guids& x)
|
||||
void operator=(Lfg5Guids const& x)
|
||||
{
|
||||
guids = x.guids;
|
||||
delete roles;
|
||||
|
||||
@@ -513,7 +513,7 @@ namespace lfg
|
||||
else if (ar)
|
||||
{
|
||||
// Check required items
|
||||
for (const ProgressionRequirement* itemRequirement : ar->items)
|
||||
for (ProgressionRequirement const* itemRequirement : ar->items)
|
||||
{
|
||||
if (!itemRequirement->checkLeaderOnly || !group || group->GetLeaderGUID() == player->GetGUID())
|
||||
{
|
||||
@@ -529,7 +529,7 @@ namespace lfg
|
||||
}
|
||||
|
||||
//Check for quests
|
||||
for (const ProgressionRequirement* questRequirement : ar->quests)
|
||||
for (ProgressionRequirement const* questRequirement : ar->quests)
|
||||
{
|
||||
if (!questRequirement->checkLeaderOnly || !group || group->GetLeaderGUID() == player->GetGUID())
|
||||
{
|
||||
@@ -551,7 +551,7 @@ namespace lfg
|
||||
}
|
||||
|
||||
//Check if player has the required achievements
|
||||
for (const ProgressionRequirement* achievementRequirement : ar->achievements)
|
||||
for (ProgressionRequirement const* achievementRequirement : ar->achievements)
|
||||
{
|
||||
if (!achievementRequirement->checkLeaderOnly || !group || group->GetLeaderGUID() == player->GetGUID())
|
||||
{
|
||||
@@ -595,7 +595,7 @@ namespace lfg
|
||||
@param[in] dungeons Dungeons the player/group is applying for
|
||||
@param[in] comment Player selected comment
|
||||
*/
|
||||
void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const std::string& comment)
|
||||
void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, std::string const& comment)
|
||||
{
|
||||
if (!player || dungeons.empty())
|
||||
return;
|
||||
@@ -919,7 +919,7 @@ namespace lfg
|
||||
queue.RemoveFromQueue(gguid);
|
||||
uint32 dungeonId = GetDungeon(gguid);
|
||||
SetState(gguid, LFG_STATE_NONE);
|
||||
const LfgGuidSet& players = GetPlayers(gguid);
|
||||
LfgGuidSet const& players = GetPlayers(gguid);
|
||||
for (LfgGuidSet::const_iterator it = players.begin(); it != players.end(); ++it)
|
||||
{
|
||||
SetState(*it, LFG_STATE_NONE);
|
||||
@@ -1318,7 +1318,7 @@ namespace lfg
|
||||
}
|
||||
}
|
||||
|
||||
void LFGMgr::RBPacketAppendGroup(const RBInternalInfo& info, ByteBuffer& buffer)
|
||||
void LFGMgr::RBPacketAppendGroup(RBInternalInfo const& info, ByteBuffer& buffer)
|
||||
{
|
||||
buffer << info.groupGuid;
|
||||
uint32 flags = LFG_UPDATE_FLAG_COMMENT | LFG_UPDATE_FLAG_ROLES | LFG_UPDATE_FLAG_BINDED;
|
||||
@@ -1334,7 +1334,7 @@ namespace lfg
|
||||
buffer << (uint32)info.encounterMask;
|
||||
}
|
||||
|
||||
void LFGMgr::RBPacketAppendPlayer(const RBInternalInfo& info, ByteBuffer& buffer)
|
||||
void LFGMgr::RBPacketAppendPlayer(RBInternalInfo const& info, ByteBuffer& buffer)
|
||||
{
|
||||
buffer << info.guid;
|
||||
uint32 flags = LFG_UPDATE_FLAG_CHARACTERINFO | LFG_UPDATE_FLAG_ROLES | LFG_UPDATE_FLAG_COMMENT | (info.groupGuid ? LFG_UPDATE_FLAG_GROUPGUID : LFG_UPDATE_FLAG_BINDED) | (info.isGroupLeader ? LFG_UPDATE_FLAG_GROUPLEADER : 0) | (!info.groupGuid || info.isGroupLeader ? LFG_UPDATE_FLAG_AREA : 0);
|
||||
@@ -1467,7 +1467,7 @@ namespace lfg
|
||||
if (GetState(gguid) == LFG_STATE_QUEUED)
|
||||
{
|
||||
SetState(gguid, LFG_STATE_NONE);
|
||||
const LfgGuidSet& players = GetPlayers(gguid);
|
||||
LfgGuidSet const& players = GetPlayers(gguid);
|
||||
for (LfgGuidSet::const_iterator it = players.begin(); it != players.end(); ++it)
|
||||
{
|
||||
SetState(*it, LFG_STATE_NONE);
|
||||
@@ -2315,7 +2315,7 @@ namespace lfg
|
||||
@param[in] guid Group guid
|
||||
@param[in] dungeonId Dungeonid
|
||||
*/
|
||||
void LFGMgr::FinishDungeon(ObjectGuid gguid, const uint32 dungeonId, const Map* currMap)
|
||||
void LFGMgr::FinishDungeon(ObjectGuid gguid, const uint32 dungeonId, Map const* currMap)
|
||||
{
|
||||
uint32 gDungeonId = GetDungeon(gguid);
|
||||
if (gDungeonId != dungeonId)
|
||||
@@ -2333,7 +2333,7 @@ namespace lfg
|
||||
SetState(gguid, LFG_STATE_FINISHED_DUNGEON);
|
||||
_SaveToDB(gguid); // pussywizard
|
||||
|
||||
const LfgGuidSet& players = GetPlayers(gguid);
|
||||
LfgGuidSet const& players = GetPlayers(gguid);
|
||||
for (LfgGuidSet::const_iterator it = players.begin(); it != players.end(); ++it)
|
||||
{
|
||||
ObjectGuid guid = (*it);
|
||||
@@ -2344,7 +2344,7 @@ namespace lfg
|
||||
}
|
||||
|
||||
uint32 rDungeonId = 0;
|
||||
const LfgDungeonSet& dungeons = GetSelectedDungeons(guid);
|
||||
LfgDungeonSet const& dungeons = GetSelectedDungeons(guid);
|
||||
if (!dungeons.empty())
|
||||
rDungeonId = (*dungeons.begin());
|
||||
|
||||
@@ -2522,7 +2522,7 @@ namespace lfg
|
||||
return roles;
|
||||
}
|
||||
|
||||
const std::string& LFGMgr::GetComment(ObjectGuid guid)
|
||||
std::string const& LFGMgr::GetComment(ObjectGuid guid)
|
||||
{
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetComment: [{}] = {}", guid.ToString(), PlayersStore[guid].GetComment());
|
||||
return PlayersStore[guid].GetComment();
|
||||
@@ -2692,7 +2692,7 @@ namespace lfg
|
||||
|
||||
void LFGMgr::AddPlayerQueuedForRandomDungeonToGroup(ObjectGuid gguid, ObjectGuid guid)
|
||||
{
|
||||
const LfgDungeonSet& dungeons = GetSelectedDungeons(guid);
|
||||
LfgDungeonSet const& dungeons = GetSelectedDungeons(guid);
|
||||
if (dungeons.empty())
|
||||
return;
|
||||
|
||||
|
||||
@@ -446,7 +446,7 @@ namespace lfg
|
||||
|
||||
// World.cpp
|
||||
/// Finish the dungeon for the given group. All check are performed using internal lfg data
|
||||
void FinishDungeon(ObjectGuid gguid, uint32 dungeonId, const Map* currMap);
|
||||
void FinishDungeon(ObjectGuid gguid, uint32 dungeonId, Map const* currMap);
|
||||
/// Loads rewards for random dungeons
|
||||
void LoadRewards();
|
||||
/// Loads dungeons from dbc and adds teleport coords
|
||||
@@ -561,8 +561,8 @@ namespace lfg
|
||||
void UpdateRaidBrowser(uint32 diff);
|
||||
void LfrSetComment(Player* p, std::string comment);
|
||||
void SendRaidBrowserJoinedPacket(Player* p, LfgDungeonSet& dungeons, std::string comment);
|
||||
void RBPacketAppendGroup(const RBInternalInfo& info, ByteBuffer& buffer);
|
||||
void RBPacketAppendPlayer(const RBInternalInfo& info, ByteBuffer& buffer);
|
||||
void RBPacketAppendGroup(RBInternalInfo const& info, ByteBuffer& buffer);
|
||||
void RBPacketAppendPlayer(RBInternalInfo const& info, ByteBuffer& buffer);
|
||||
void RBPacketBuildDifference(WorldPacket& differencePacket, uint32 dungeonId, uint32 deletedCounter, ByteBuffer const& bufferDeleted, uint32 groupCounter, ByteBuffer const& bufferGroups, uint32 playerCounter, ByteBuffer const& bufferPlayers);
|
||||
void RBPacketBuildFull(WorldPacket& fullPacket, uint32 dungeonId, RBInternalInfoMap const& infoMap);
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace lfg
|
||||
return m_OldState;
|
||||
}
|
||||
|
||||
const LfgLockMap& LfgPlayerData::GetLockedDungeons() const
|
||||
LfgLockMap const& LfgPlayerData::GetLockedDungeons() const
|
||||
{
|
||||
return m_LockedDungeons;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace lfg
|
||||
// Queue
|
||||
void SetRoles(uint8 roles);
|
||||
void SetComment(std::string const& comment);
|
||||
void SetSelectedDungeons(const LfgDungeonSet& dungeons);
|
||||
void SetSelectedDungeons(LfgDungeonSet const& dungeons);
|
||||
|
||||
// General
|
||||
[[nodiscard]] LfgState GetState() const;
|
||||
|
||||
@@ -194,7 +194,7 @@ namespace lfg
|
||||
return newGroupsProcessed;
|
||||
}
|
||||
|
||||
LfgCompatibility LFGQueue::FindNewGroups(const ObjectGuid& newGuid)
|
||||
LfgCompatibility LFGQueue::FindNewGroups(ObjectGuid const& newGuid)
|
||||
{
|
||||
// each combination of dps+heal+tank (tank*8 + heal+4 + dps) has a value assigned 0..15
|
||||
// first 16 bits of the mask are for marking if such combination was found once, second 16 bits for marking second occurence of that combination, etc
|
||||
@@ -243,7 +243,7 @@ namespace lfg
|
||||
return selfCompatibility;
|
||||
}
|
||||
|
||||
LfgCompatibility LFGQueue::CheckCompatibility(Lfg5Guids const& checkWith, const ObjectGuid& newGuid, uint64& foundMask, uint32& foundCount, const std::set<Lfg5Guids>& currentCompatibles)
|
||||
LfgCompatibility LFGQueue::CheckCompatibility(Lfg5Guids const& checkWith, ObjectGuid const& newGuid, uint64& foundMask, uint32& foundCount, std::set<Lfg5Guids> const& currentCompatibles)
|
||||
{
|
||||
LOG_DEBUG("lfg", "CHECK CheckCompatibility: {}, new guid: {}", checkWith.toString(), newGuid.ToString());
|
||||
Lfg5Guids check(checkWith, false); // here newGuid is at front
|
||||
@@ -315,7 +315,7 @@ namespace lfg
|
||||
{
|
||||
for (uint8 i = 0; i < 5 && check.guids[i]; ++i)
|
||||
{
|
||||
const LfgRolesMap& roles = QueueDataStore[check.guids[i]].roles;
|
||||
LfgRolesMap const& roles = QueueDataStore[check.guids[i]].roles;
|
||||
for (LfgRolesMap::const_iterator itRoles = roles.begin(); itRoles != roles.end(); ++itRoles)
|
||||
{
|
||||
LfgRolesMap::const_iterator itPlayer;
|
||||
@@ -383,7 +383,7 @@ namespace lfg
|
||||
else
|
||||
{
|
||||
ObjectGuid gguid = check.front();
|
||||
const LfgQueueData& queue = QueueDataStore[gguid];
|
||||
LfgQueueData const& queue = QueueDataStore[gguid];
|
||||
proposalDungeons = queue.dungeons;
|
||||
proposalRoles = queue.roles;
|
||||
LFGMgr::CheckGroupRoles(proposalRoles); // assing new roles
|
||||
|
||||
@@ -103,8 +103,8 @@ namespace lfg
|
||||
uint32 FindBestCompatibleInQueue(LfgQueueDataContainer::iterator itrQueue);
|
||||
void UpdateBestCompatibleInQueue(LfgQueueDataContainer::iterator itrQueue, Lfg5Guids const& key);
|
||||
|
||||
LfgCompatibility FindNewGroups(const ObjectGuid& newGuid);
|
||||
LfgCompatibility CheckCompatibility(Lfg5Guids const& checkWith, const ObjectGuid& newGuid, uint64& foundMask, uint32& foundCount, const std::set<Lfg5Guids>& currentCompatibles);
|
||||
LfgCompatibility FindNewGroups(ObjectGuid const& newGuid);
|
||||
LfgCompatibility CheckCompatibility(Lfg5Guids const& checkWith, ObjectGuid const& newGuid, uint64& foundMask, uint32& foundCount, std::set<Lfg5Guids> const& currentCompatibles);
|
||||
|
||||
// Queue
|
||||
uint32 m_QueueStatusTimer; // used to check interval of sending queue status
|
||||
|
||||
@@ -474,7 +474,7 @@ void Creature::RemoveCorpse(bool setSpawnTime, bool skipVisibility)
|
||||
/**
|
||||
* change the entry of creature until respawn
|
||||
*/
|
||||
bool Creature::InitEntry(uint32 Entry, const CreatureData* data)
|
||||
bool Creature::InitEntry(uint32 Entry, CreatureData const* data)
|
||||
{
|
||||
CreatureTemplate const* normalInfo = sObjectMgr->GetCreatureTemplate(Entry);
|
||||
if (!normalInfo)
|
||||
@@ -578,7 +578,7 @@ bool Creature::InitEntry(uint32 Entry, const CreatureData* data)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Creature::UpdateEntry(uint32 Entry, const CreatureData* data, bool changelevel, bool updateAI)
|
||||
bool Creature::UpdateEntry(uint32 Entry, CreatureData const* data, bool changelevel, bool updateAI)
|
||||
{
|
||||
if (!InitEntry(Entry, data))
|
||||
return false;
|
||||
@@ -1148,7 +1148,7 @@ void Creature::Motion_Initialize()
|
||||
GetMotionMaster()->Initialize();
|
||||
}
|
||||
|
||||
bool Creature::Create(ObjectGuid::LowType guidlow, Map* map, uint32 phaseMask, uint32 Entry, uint32 vehId, float x, float y, float z, float ang, const CreatureData* data)
|
||||
bool Creature::Create(ObjectGuid::LowType guidlow, Map* map, uint32 phaseMask, uint32 Entry, uint32 vehId, float x, float y, float z, float ang, CreatureData const* data)
|
||||
{
|
||||
ASSERT(map);
|
||||
SetMap(map);
|
||||
@@ -1612,7 +1612,7 @@ float Creature::GetSpellDamageMod(int32 Rank)
|
||||
}
|
||||
}
|
||||
|
||||
bool Creature::CreateFromProto(ObjectGuid::LowType guidlow, uint32 Entry, uint32 vehId, const CreatureData* data)
|
||||
bool Creature::CreateFromProto(ObjectGuid::LowType guidlow, uint32 Entry, uint32 vehId, CreatureData const* data)
|
||||
{
|
||||
SetZoneScript();
|
||||
if (GetZoneScript() && data)
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
|
||||
[[nodiscard]] bool isVendorWithIconSpeak() const;
|
||||
|
||||
bool Create(ObjectGuid::LowType guidlow, Map* map, uint32 phaseMask, uint32 Entry, uint32 vehId, float x, float y, float z, float ang, const CreatureData* data = nullptr);
|
||||
bool Create(ObjectGuid::LowType guidlow, Map* map, uint32 phaseMask, uint32 Entry, uint32 vehId, float x, float y, float z, float ang, CreatureData const* data = nullptr);
|
||||
bool LoadCreaturesAddon(bool reload = false);
|
||||
void SelectLevel(bool changelevel = true);
|
||||
void LoadEquipment(int8 id = 1, bool force = false);
|
||||
@@ -175,7 +175,7 @@ public:
|
||||
|
||||
void UpdateMovementFlags();
|
||||
uint32 GetRandomId(uint32 id1, uint32 id2, uint32 id3);
|
||||
bool UpdateEntry(uint32 entry, const CreatureData* data = nullptr, bool changelevel = true, bool updateAI = false);
|
||||
bool UpdateEntry(uint32 entry, CreatureData const* data = nullptr, bool changelevel = true, bool updateAI = false);
|
||||
bool UpdateEntry(uint32 entry, bool updateAI) { return UpdateEntry(entry, nullptr, true, updateAI); }
|
||||
bool UpdateStats(Stats stat) override;
|
||||
bool UpdateAllStats() override;
|
||||
@@ -342,15 +342,15 @@ public:
|
||||
[[nodiscard]] bool IsNotReachableAndNeedRegen() const;
|
||||
|
||||
void SetPosition(float x, float y, float z, float o);
|
||||
void SetPosition(const Position& pos) { SetPosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation()); }
|
||||
void SetPosition(Position const& pos) { SetPosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation()); }
|
||||
|
||||
void SetHomePosition(float x, float y, float z, float o) { m_homePosition.Relocate(x, y, z, o); }
|
||||
void SetHomePosition(const Position& pos) { m_homePosition.Relocate(pos); }
|
||||
void SetHomePosition(Position const& pos) { m_homePosition.Relocate(pos); }
|
||||
void GetHomePosition(float& x, float& y, float& z, float& ori) const { m_homePosition.GetPosition(x, y, z, ori); }
|
||||
[[nodiscard]] Position const& GetHomePosition() const { return m_homePosition; }
|
||||
|
||||
void SetTransportHomePosition(float x, float y, float z, float o) { m_transportHomePosition.Relocate(x, y, z, o); }
|
||||
void SetTransportHomePosition(const Position& pos) { m_transportHomePosition.Relocate(pos); }
|
||||
void SetTransportHomePosition(Position const& pos) { m_transportHomePosition.Relocate(pos); }
|
||||
void GetTransportHomePosition(float& x, float& y, float& z, float& ori) const { m_transportHomePosition.GetPosition(x, y, z, ori); }
|
||||
[[nodiscard]] Position const& GetTransportHomePosition() const { return m_transportHomePosition; }
|
||||
|
||||
@@ -460,8 +460,8 @@ public:
|
||||
bool IsUpdateNeeded() override;
|
||||
|
||||
protected:
|
||||
bool CreateFromProto(ObjectGuid::LowType guidlow, uint32 Entry, uint32 vehId, const CreatureData* data = nullptr);
|
||||
bool InitEntry(uint32 entry, const CreatureData* data = nullptr);
|
||||
bool CreateFromProto(ObjectGuid::LowType guidlow, uint32 Entry, uint32 vehId, CreatureData const* data = nullptr);
|
||||
bool InitEntry(uint32 entry, CreatureData const* data = nullptr);
|
||||
|
||||
// vendor items
|
||||
VendorItemCounts m_vendorItemCounts;
|
||||
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
bool IsEmpty() const { return m_members.empty(); }
|
||||
bool IsFormed() const { return m_Formed; }
|
||||
|
||||
const CreatureGroupMemberType& GetMembers() const { return m_members; }
|
||||
CreatureGroupMemberType const& GetMembers() const { return m_members; }
|
||||
|
||||
void AddMember(Creature* member);
|
||||
void RemoveMember(Creature* member);
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
void SetVisibleBySummonerOnly(bool visibleBySummonerOnly) { _visibleBySummonerOnly = visibleBySummonerOnly; }
|
||||
[[nodiscard]] bool IsVisibleBySummonerOnly() const { return _visibleBySummonerOnly; }
|
||||
|
||||
const SummonPropertiesEntry* const m_Properties;
|
||||
SummonPropertiesEntry const* const m_Properties;
|
||||
|
||||
std::string GetDebugInfo() const override;
|
||||
|
||||
|
||||
@@ -1031,7 +1031,7 @@ void GameObject::SaveToDB(bool saveAddon /*= false*/)
|
||||
|
||||
void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask, bool saveAddon /*= false*/)
|
||||
{
|
||||
const GameObjectTemplate* goI = GetGOInfo();
|
||||
GameObjectTemplate const* goI = GetGOInfo();
|
||||
|
||||
if (!goI)
|
||||
return;
|
||||
@@ -1431,7 +1431,7 @@ void GameObject::SetGoArtKit(uint8 kit)
|
||||
|
||||
void GameObject::SetGoArtKit(uint8 artkit, GameObject* go, ObjectGuid::LowType lowguid)
|
||||
{
|
||||
const GameObjectData* data = nullptr;
|
||||
GameObjectData const* data = nullptr;
|
||||
if (go)
|
||||
{
|
||||
go->SetGoArtKit(artkit);
|
||||
@@ -2815,7 +2815,7 @@ void GameObject::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* t
|
||||
dynFlags |= GO_DYNFLAG_LO_SPARKLE;
|
||||
break;
|
||||
case GAMEOBJECT_TYPE_TRANSPORT:
|
||||
if (const StaticTransport* t = ToStaticTransport())
|
||||
if (StaticTransport const* t = ToStaticTransport())
|
||||
if (t->GetPauseTime())
|
||||
{
|
||||
if (GetGoState() == GO_STATE_READY)
|
||||
@@ -2832,7 +2832,7 @@ void GameObject::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* t
|
||||
// else it's ignored
|
||||
break;
|
||||
case GAMEOBJECT_TYPE_MO_TRANSPORT:
|
||||
if (const MotionTransport* t = ToMotionTransport())
|
||||
if (MotionTransport const* t = ToMotionTransport())
|
||||
pathProgress = int16(float(t->GetPathProgress()) / float(t->GetPeriod()) * 65535.0f);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -314,7 +314,7 @@ public:
|
||||
void GetRespawnPosition(float& x, float& y, float& z, float* ori = nullptr) const;
|
||||
|
||||
void SetPosition(float x, float y, float z, float o);
|
||||
void SetPosition(const Position& pos) { SetPosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation()); }
|
||||
void SetPosition(Position const& pos) { SetPosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation()); }
|
||||
|
||||
[[nodiscard]] bool IsStaticTransport() const { return GetGOInfo()->type == GAMEOBJECT_TYPE_TRANSPORT; }
|
||||
[[nodiscard]] bool IsMotionTransport() const { return GetGOInfo()->type == GAMEOBJECT_TYPE_MO_TRANSPORT; }
|
||||
|
||||
@@ -248,7 +248,7 @@ public:
|
||||
void DeleteRefundDataFromDB(CharacterDatabaseTransaction* trans);
|
||||
|
||||
Bag* ToBag() { if (IsBag()) return reinterpret_cast<Bag*>(this); else return nullptr; }
|
||||
[[nodiscard]] const Bag* ToBag() const { if (IsBag()) return reinterpret_cast<const Bag*>(this); else return nullptr; }
|
||||
[[nodiscard]] Bag const* ToBag() const { if (IsBag()) return reinterpret_cast<Bag const*>(this); else return nullptr; }
|
||||
|
||||
[[nodiscard]] bool IsLocked() const { return !HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_UNLOCKED); }
|
||||
[[nodiscard]] bool IsBag() const { return GetTemplate()->InventoryType == INVTYPE_BAG; }
|
||||
|
||||
@@ -1298,7 +1298,7 @@ float WorldObject::GetDistance(WorldObject const* obj) const
|
||||
return d > 0.0f ? d : 0.0f;
|
||||
}
|
||||
|
||||
[[nodiscard]] float WorldObject::GetDistance(const Position& pos) const
|
||||
[[nodiscard]] float WorldObject::GetDistance(Position const& pos) const
|
||||
{
|
||||
float d = GetExactDist(&pos) - GetObjectSize();
|
||||
return d > 0.0f ? d : 0.0f;
|
||||
@@ -1347,7 +1347,7 @@ bool WorldObject::IsInMap(WorldObject const* obj) const
|
||||
return IsInDist(x, y, z, dist + GetObjectSize());
|
||||
}
|
||||
|
||||
bool WorldObject::IsWithinDist3d(const Position* pos, float dist) const
|
||||
bool WorldObject::IsWithinDist3d(Position const* pos, float dist) const
|
||||
{
|
||||
return IsInDist(pos, dist + GetObjectSize());
|
||||
}
|
||||
@@ -1357,7 +1357,7 @@ bool WorldObject::IsWithinDist3d(const Position* pos, float dist) const
|
||||
return IsInDist2d(x, y, dist + GetObjectSize());
|
||||
}
|
||||
|
||||
bool WorldObject::IsWithinDist2d(const Position* pos, float dist) const
|
||||
bool WorldObject::IsWithinDist2d(Position const* pos, float dist) const
|
||||
{
|
||||
return IsInDist2d(pos, dist + GetObjectSize());
|
||||
}
|
||||
@@ -1555,7 +1555,7 @@ bool WorldObject::isInBack(WorldObject const* target, float arc) const
|
||||
return !HasInArc(2 * M_PI - arc, target);
|
||||
}
|
||||
|
||||
void WorldObject::GetRandomPoint(const Position& pos, float distance, float& rand_x, float& rand_y, float& rand_z) const
|
||||
void WorldObject::GetRandomPoint(Position const& pos, float distance, float& rand_x, float& rand_y, float& rand_z) const
|
||||
{
|
||||
if (!distance)
|
||||
{
|
||||
@@ -1576,7 +1576,7 @@ void WorldObject::GetRandomPoint(const Position& pos, float distance, float& ran
|
||||
UpdateGroundPositionZ(rand_x, rand_y, rand_z); // update to LOS height if available
|
||||
}
|
||||
|
||||
Position WorldObject::GetRandomPoint(const Position& srcPos, float distance) const
|
||||
Position WorldObject::GetRandomPoint(Position const& srcPos, float distance) const
|
||||
{
|
||||
float x, y, z;
|
||||
GetRandomPoint(srcPos, distance, x, y, z);
|
||||
@@ -2441,7 +2441,7 @@ void WorldObject::ClearZoneScript()
|
||||
m_zoneScript = nullptr;
|
||||
}
|
||||
|
||||
TempSummon* WorldObject::SummonCreature(uint32 entry, const Position& pos, TempSummonType spwtype, uint32 duration, uint32 /*vehId*/, SummonPropertiesEntry const* properties, bool visibleBySummonerOnly /*= false*/) const
|
||||
TempSummon* WorldObject::SummonCreature(uint32 entry, Position const& pos, TempSummonType spwtype, uint32 duration, uint32 /*vehId*/, SummonPropertiesEntry const* properties, bool visibleBySummonerOnly /*= false*/) const
|
||||
{
|
||||
if (Map* map = FindMap())
|
||||
{
|
||||
|
||||
@@ -280,7 +280,7 @@ private:
|
||||
|
||||
// for output helpfull error messages from asserts
|
||||
[[nodiscard]] bool PrintIndexError(uint32 index, bool set) const;
|
||||
Object(const Object&); // prevent generation copy constructor
|
||||
Object(Object const&); // prevent generation copy constructor
|
||||
Object& operator=(Object const&); // prevent generation assigment operator
|
||||
};
|
||||
|
||||
@@ -507,8 +507,8 @@ public:
|
||||
void UpdateGroundPositionZ(float x, float y, float& z) const;
|
||||
void UpdateAllowedPositionZ(float x, float y, float& z, float* groundZ = nullptr) const;
|
||||
|
||||
void GetRandomPoint(const Position& srcPos, float distance, float& rand_x, float& rand_y, float& rand_z) const;
|
||||
[[nodiscard]] Position GetRandomPoint(const Position& srcPos, float distance) const;
|
||||
void GetRandomPoint(Position const& srcPos, float distance, float& rand_x, float& rand_y, float& rand_z) const;
|
||||
[[nodiscard]] Position GetRandomPoint(Position const& srcPos, float distance) const;
|
||||
|
||||
[[nodiscard]] uint32 GetInstanceId() const { return m_InstanceId; }
|
||||
|
||||
@@ -531,7 +531,7 @@ public:
|
||||
[[nodiscard]] virtual std::string const& GetNameForLocaleIdx(LocaleConstant /*locale_idx*/) const { return m_name; }
|
||||
|
||||
float GetDistance(WorldObject const* obj) const;
|
||||
[[nodiscard]] float GetDistance(const Position& pos) const;
|
||||
[[nodiscard]] float GetDistance(Position const& pos) const;
|
||||
[[nodiscard]] float GetDistance(float x, float y, float z) const;
|
||||
float GetDistance2d(WorldObject const* obj) const;
|
||||
[[nodiscard]] float GetDistance2d(float x, float y) const;
|
||||
@@ -540,9 +540,9 @@ public:
|
||||
bool IsSelfOrInSameMap(WorldObject const* obj) const;
|
||||
bool IsInMap(WorldObject const* obj) const;
|
||||
[[nodiscard]] bool IsWithinDist3d(float x, float y, float z, float dist) const;
|
||||
bool IsWithinDist3d(const Position* pos, float dist) const;
|
||||
bool IsWithinDist3d(Position const* pos, float dist) const;
|
||||
[[nodiscard]] bool IsWithinDist2d(float x, float y, float dist) const;
|
||||
bool IsWithinDist2d(const Position* pos, float dist) const;
|
||||
bool IsWithinDist2d(Position const* pos, float dist) const;
|
||||
virtual bool IsWithinSightRange(Position const& pos, float dist) const;
|
||||
// use only if you will sure about placing both object at same map
|
||||
bool IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D = true, bool incOwnRadius = true, bool incTargetRadius = true) const;
|
||||
@@ -635,7 +635,7 @@ public:
|
||||
void ClearZoneScript();
|
||||
[[nodiscard]] ZoneScript* GetZoneScript() const { return m_zoneScript; }
|
||||
|
||||
TempSummon* SummonCreature(uint32 id, const Position& pos, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0, uint32 vehId = 0, SummonPropertiesEntry const* properties = nullptr, bool visibleBySummonerOnly = false) const;
|
||||
TempSummon* SummonCreature(uint32 id, Position const& pos, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0, uint32 vehId = 0, SummonPropertiesEntry const* properties = nullptr, bool visibleBySummonerOnly = false) const;
|
||||
TempSummon* SummonCreature(uint32 id, float x, float y, float z, float ang = 0, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0, SummonPropertiesEntry const* properties = nullptr, bool visibleBySummonerOnly = false);
|
||||
GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport = true, GOSummonType summonType = GO_SUMMON_TIMED_OR_CORPSE_DESPAWN);
|
||||
Creature* SummonTrigger(float x, float y, float z, float ang, uint32 dur, bool setLevel = false, CreatureAI * (*GetAI)(Creature*) = nullptr);
|
||||
|
||||
@@ -63,7 +63,7 @@ std::string Position::ToString() const
|
||||
return sstr.str();
|
||||
}
|
||||
|
||||
void Position::RelocateOffset(const Position& offset)
|
||||
void Position::RelocateOffset(Position const& offset)
|
||||
{
|
||||
m_positionX = GetPositionX() + (offset.GetPositionX() * std::cos(GetOrientation()) + offset.GetPositionY() * std::sin(GetOrientation() + M_PI));
|
||||
m_positionY = GetPositionY() + (offset.GetPositionY() * std::cos(GetOrientation()) + offset.GetPositionX() * std::sin(GetOrientation()));
|
||||
@@ -71,7 +71,7 @@ void Position::RelocateOffset(const Position& offset)
|
||||
m_orientation = GetOrientation() + offset.GetOrientation();
|
||||
}
|
||||
|
||||
void Position::GetPositionOffsetTo(const Position& endPos, Position& retOffset) const
|
||||
void Position::GetPositionOffsetTo(Position const& endPos, Position& retOffset) const
|
||||
{
|
||||
float dx = endPos.GetPositionX() - GetPositionX();
|
||||
float dy = endPos.GetPositionY() - GetPositionY();
|
||||
@@ -82,7 +82,7 @@ void Position::GetPositionOffsetTo(const Position& endPos, Position& retOffset)
|
||||
retOffset.m_orientation = endPos.GetOrientation() - GetOrientation();
|
||||
}
|
||||
|
||||
float Position::GetAngle(const Position* obj) const
|
||||
float Position::GetAngle(Position const* obj) const
|
||||
{
|
||||
if (!obj)
|
||||
return 0;
|
||||
@@ -115,7 +115,7 @@ void Position::GetSinCos(const float x, const float y, float& vsin, float& vcos)
|
||||
}
|
||||
}
|
||||
|
||||
bool Position::IsWithinBox(const Position& center, float xradius, float yradius, float zradius) const
|
||||
bool Position::IsWithinBox(Position const& center, float xradius, float yradius, float zradius) const
|
||||
{
|
||||
// rotate the WorldObject position instead of rotating the whole cube, that way we can make a simplified
|
||||
// is-in-cube check and we have to calculate only one point instead of 4
|
||||
@@ -145,7 +145,7 @@ bool Position::IsWithinBox(const Position& center, float xradius, float yradius,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Position::HasInArc(float arc, const Position* obj, float targetRadius) const
|
||||
bool Position::HasInArc(float arc, Position const* obj, float targetRadius) const
|
||||
{
|
||||
// always have self in arc
|
||||
if (obj == this)
|
||||
|
||||
@@ -31,7 +31,7 @@ struct Position
|
||||
Position(Position const& loc) { Relocate(loc); }
|
||||
/* requried as of C++ 11 */
|
||||
Position(Position&&) = default;
|
||||
Position& operator=(const Position&) = default;
|
||||
Position& operator=(Position const&) = default;
|
||||
Position& operator=(Position&&) = default;
|
||||
|
||||
struct PositionXYStreamer
|
||||
@@ -95,7 +95,7 @@ struct Position
|
||||
m_orientation = orientation;
|
||||
}
|
||||
|
||||
void Relocate(const Position& pos)
|
||||
void Relocate(Position const& pos)
|
||||
{
|
||||
m_positionX = pos.m_positionX;
|
||||
m_positionY = pos.m_positionY;
|
||||
@@ -103,7 +103,7 @@ struct Position
|
||||
m_orientation = pos.m_orientation;
|
||||
}
|
||||
|
||||
void Relocate(const Position* pos)
|
||||
void Relocate(Position const* pos)
|
||||
{
|
||||
m_positionX = pos->m_positionX;
|
||||
m_positionY = pos->m_positionY;
|
||||
@@ -112,7 +112,7 @@ struct Position
|
||||
}
|
||||
|
||||
void RelocatePolarOffset(float angle, float dist, float z = 0.0f);
|
||||
void RelocateOffset(const Position& offset);
|
||||
void RelocateOffset(Position const& offset);
|
||||
void SetOrientation(float orientation)
|
||||
{
|
||||
m_orientation = orientation;
|
||||
@@ -183,10 +183,10 @@ struct Position
|
||||
[[nodiscard]] float GetExactDist(Position const& pos) const { return GetExactDist(pos.m_positionX, pos.m_positionY, pos.m_positionZ); }
|
||||
float GetExactDist(Position const* pos) const { return GetExactDist(*pos); }
|
||||
|
||||
void GetPositionOffsetTo(const Position& endPos, Position& retOffset) const;
|
||||
void GetPositionOffsetTo(Position const& endPos, Position& retOffset) const;
|
||||
[[nodiscard]] Position GetPositionWithOffset(Position const& offset) const;
|
||||
|
||||
float GetAngle(const Position* pos) const;
|
||||
float GetAngle(Position const* pos) const;
|
||||
[[nodiscard]] float GetAngle(float x, float y) const;
|
||||
[[nodiscard]] float GetAbsoluteAngle(float x, float y) const
|
||||
{
|
||||
@@ -198,7 +198,7 @@ struct Position
|
||||
[[nodiscard]] float GetAbsoluteAngle(Position const& pos) const { return GetAbsoluteAngle(pos.m_positionX, pos.m_positionY); }
|
||||
[[nodiscard]] float GetAbsoluteAngle(Position const* pos) const { return GetAbsoluteAngle(*pos); }
|
||||
|
||||
float GetRelativeAngle(const Position* pos) const
|
||||
float GetRelativeAngle(Position const* pos) const
|
||||
{
|
||||
return NormalizeOrientation(GetAngle(pos) - m_orientation);
|
||||
}
|
||||
@@ -213,7 +213,7 @@ struct Position
|
||||
return GetExactDist2dSq(x, y) < dist * dist;
|
||||
}
|
||||
|
||||
bool IsInDist2d(const Position* pos, float dist) const
|
||||
bool IsInDist2d(Position const* pos, float dist) const
|
||||
{
|
||||
return GetExactDist2dSq(pos) < dist * dist;
|
||||
}
|
||||
@@ -223,13 +223,13 @@ struct Position
|
||||
return GetExactDistSq(x, y, z) < dist * dist;
|
||||
}
|
||||
|
||||
bool IsInDist(const Position* pos, float dist) const
|
||||
bool IsInDist(Position const* pos, float dist) const
|
||||
{
|
||||
return GetExactDistSq(pos) < dist * dist;
|
||||
}
|
||||
|
||||
[[nodiscard]] bool IsWithinBox(const Position& center, float xradius, float yradius, float zradius) const;
|
||||
bool HasInArc(float arcangle, const Position* pos, float targetRadius = 0.0f) const;
|
||||
[[nodiscard]] bool IsWithinBox(Position const& center, float xradius, float yradius, float zradius) const;
|
||||
bool HasInArc(float arcangle, Position const* pos, float targetRadius = 0.0f) const;
|
||||
bool HasInLine(Position const* pos, float width) const;
|
||||
bool HasInLine(Position const* pos, float objSize, float width) const;
|
||||
[[nodiscard]] std::string ToString() const;
|
||||
@@ -261,7 +261,7 @@ public:
|
||||
WorldLocation(uint32 mapId, Position const& position)
|
||||
: Position(position), m_mapId(mapId) { }
|
||||
|
||||
void WorldRelocate(const WorldLocation& loc)
|
||||
void WorldRelocate(WorldLocation const& loc)
|
||||
{
|
||||
m_mapId = loc.GetMapId();
|
||||
Relocate(loc);
|
||||
|
||||
@@ -33,13 +33,13 @@ void UpdateData::AddOutOfRangeGUID(ObjectGuid guid)
|
||||
m_outOfRangeGUIDs.push_back(guid);
|
||||
}
|
||||
|
||||
void UpdateData::AddUpdateBlock(const ByteBuffer& block)
|
||||
void UpdateData::AddUpdateBlock(ByteBuffer const& block)
|
||||
{
|
||||
m_data.append(block);
|
||||
++m_blockCount;
|
||||
}
|
||||
|
||||
void UpdateData::AddUpdateBlock(const UpdateData& block)
|
||||
void UpdateData::AddUpdateBlock(UpdateData const& block)
|
||||
{
|
||||
m_data.append(block.m_data);
|
||||
m_blockCount += block.m_blockCount;
|
||||
|
||||
@@ -54,8 +54,8 @@ public:
|
||||
UpdateData();
|
||||
|
||||
void AddOutOfRangeGUID(ObjectGuid guid);
|
||||
void AddUpdateBlock(const ByteBuffer& block);
|
||||
void AddUpdateBlock(const UpdateData& block);
|
||||
void AddUpdateBlock(ByteBuffer const& block);
|
||||
void AddUpdateBlock(UpdateData const& block);
|
||||
bool BuildPacket(WorldPacket& packet);
|
||||
[[nodiscard]] bool HasData() const { return m_blockCount > 0 || !m_outOfRangeGUIDs.empty(); }
|
||||
void Clear();
|
||||
|
||||
@@ -134,7 +134,7 @@ void KillRewarder::_InitXP(Player* player)
|
||||
|
||||
if (_xp && !_isBattleGround && _victim) // pussywizard: npcs with relatively low hp give lower exp
|
||||
if (_victim->IsCreature())
|
||||
if (const CreatureTemplate* ct = _victim->ToCreature()->GetCreatureTemplate())
|
||||
if (CreatureTemplate const* ct = _victim->ToCreature()->GetCreatureTemplate())
|
||||
if (ct->ModHealth <= 0.75f && ct->ModHealth >= 0.0f)
|
||||
_xp = uint32(_xp * ct->ModHealth);
|
||||
}
|
||||
|
||||
@@ -2325,7 +2325,7 @@ void Player::UninviteFromGroup()
|
||||
}
|
||||
}
|
||||
|
||||
void Player::RemoveFromGroup(Group* group, ObjectGuid guid, RemoveMethod method /* = GROUP_REMOVEMETHOD_DEFAULT*/, ObjectGuid kicker /* = ObjectGuid::Empty */, const char* reason /* = nullptr */)
|
||||
void Player::RemoveFromGroup(Group* group, ObjectGuid guid, RemoveMethod method /* = GROUP_REMOVEMETHOD_DEFAULT*/, ObjectGuid kicker /* = ObjectGuid::Empty */, char const* reason /* = nullptr */)
|
||||
{
|
||||
if (group)
|
||||
{
|
||||
@@ -11397,7 +11397,7 @@ void Player::SetEntryPoint()
|
||||
|
||||
if (GetMap()->IsDungeon())
|
||||
{
|
||||
if (const GraveyardStruct* entry = sGraveyard->GetClosestGraveyard(this, GetTeamId()))
|
||||
if (GraveyardStruct const* entry = sGraveyard->GetClosestGraveyard(this, GetTeamId()))
|
||||
m_entryPointData.joinPos = WorldLocation(entry->Map, entry->x, entry->y, entry->z, 0.0f);
|
||||
}
|
||||
else if (!GetMap()->IsBattlegroundOrArena())
|
||||
@@ -14259,7 +14259,7 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank, bool command /*= fa
|
||||
uint32 spentPoints = 0;
|
||||
if (talentInfo->Row > 0)
|
||||
{
|
||||
const PlayerTalentMap& talentMap = GetTalentMap();
|
||||
PlayerTalentMap const& talentMap = GetTalentMap();
|
||||
for (PlayerTalentMap::const_iterator itr = talentMap.begin(); itr != talentMap.end(); ++itr)
|
||||
if (TalentSpellPos const* talentPos = GetTalentSpellPos(itr->first))
|
||||
if (TalentEntry const* itrTalentInfo = sTalentStore.LookupEntry(talentPos->talent_id))
|
||||
@@ -14401,7 +14401,7 @@ void Player::LearnPetTalent(ObjectGuid petGuid, uint32 talentId, uint32 talentRa
|
||||
for (uint32 i = 0; i < numRows; ++i) // Loop through all talents.
|
||||
{
|
||||
// Someday, someone needs to revamp
|
||||
const TalentEntry* tmpTalent = sTalentStore.LookupEntry(i);
|
||||
TalentEntry const* tmpTalent = sTalentStore.LookupEntry(i);
|
||||
if (tmpTalent) // the way talents are tracked
|
||||
{
|
||||
if (tmpTalent->TalentTab == tTab)
|
||||
@@ -14655,7 +14655,7 @@ void Player::BuildPlayerTalentsInfoData(WorldPacket* data)
|
||||
std::size_t pos = data->wpos();
|
||||
*data << uint8(talentIdCount); // [PH], talentIdCount
|
||||
|
||||
const PlayerTalentMap& talentMap = GetTalentMap();
|
||||
PlayerTalentMap const& talentMap = GetTalentMap();
|
||||
for (PlayerTalentMap::const_iterator itr = talentMap.begin(); itr != talentMap.end(); ++itr)
|
||||
if (TalentSpellPos const* talentPos = GetTalentSpellPos(itr->first))
|
||||
if (itr->second->State != PLAYERSPELL_REMOVED && itr->second->IsInSpec(specIdx)) // pussywizard
|
||||
@@ -15616,7 +15616,7 @@ void Player::LoadActions(PreparedQueryResult result)
|
||||
|
||||
void Player::GetTalentTreePoints(uint8 (&specPoints)[3]) const
|
||||
{
|
||||
const PlayerTalentMap& talentMap = GetTalentMap();
|
||||
PlayerTalentMap const& talentMap = GetTalentMap();
|
||||
for (PlayerTalentMap::const_iterator itr = talentMap.begin(); itr != talentMap.end(); ++itr)
|
||||
if (itr->second->State != PLAYERSPELL_REMOVED && itr->second->IsInSpec(GetActiveSpec()))
|
||||
if (TalentEntry const* talentInfo = sTalentStore.LookupEntry(itr->second->talentID))
|
||||
@@ -15638,7 +15638,7 @@ void Player::GetTalentTreePoints(uint8 (&specPoints)[3]) const
|
||||
uint8 Player::GetMostPointsTalentTree() const
|
||||
{
|
||||
uint32 specPoints[3] = {0, 0, 0};
|
||||
const PlayerTalentMap& talentMap = GetTalentMap();
|
||||
PlayerTalentMap const& talentMap = GetTalentMap();
|
||||
for (PlayerTalentMap::const_iterator itr = talentMap.begin(); itr != talentMap.end(); ++itr)
|
||||
if (itr->second->State != PLAYERSPELL_REMOVED && itr->second->IsInSpec(GetActiveSpec()))
|
||||
if (TalentEntry const* talentInfo = sTalentStore.LookupEntry(itr->second->talentID))
|
||||
|
||||
@@ -1453,7 +1453,7 @@ public:
|
||||
bool CanSeeStartQuest(Quest const* quest);
|
||||
bool CanTakeQuest(Quest const* quest, bool msg);
|
||||
bool CanAddQuest(Quest const* quest, bool msg);
|
||||
bool CanCompleteQuest(uint32 quest_id, const QuestStatusData* q_savedStatus = nullptr);
|
||||
bool CanCompleteQuest(uint32 quest_id, QuestStatusData const* q_savedStatus = nullptr);
|
||||
bool CanCompleteRepeatableQuest(Quest const* quest);
|
||||
bool CanRewardQuest(Quest const* quest, bool msg);
|
||||
bool CanRewardQuest(Quest const* quest, uint32 reward, bool msg);
|
||||
@@ -1911,7 +1911,7 @@ public:
|
||||
bool IsInSameGroupWith(Player const* p) const;
|
||||
bool IsInSameRaidWith(Player const* p) const { return p == this || (GetGroup() != nullptr && GetGroup() == p->GetGroup()); }
|
||||
void UninviteFromGroup();
|
||||
static void RemoveFromGroup(Group* group, ObjectGuid guid, RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT, ObjectGuid kicker = ObjectGuid::Empty, const char* reason = nullptr);
|
||||
static void RemoveFromGroup(Group* group, ObjectGuid guid, RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT, ObjectGuid kicker = ObjectGuid::Empty, char const* reason = nullptr);
|
||||
void RemoveFromGroup(RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT) { RemoveFromGroup(GetGroup(), GetGUID(), method); }
|
||||
void SendUpdateToOutOfRangeGroupMembers();
|
||||
|
||||
@@ -2050,7 +2050,7 @@ public:
|
||||
void SendResetFailedNotify(uint32 mapid);
|
||||
|
||||
bool UpdatePosition(float x, float y, float z, float orientation, bool teleport = false) override;
|
||||
bool UpdatePosition(const Position& pos, bool teleport = false) { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); }
|
||||
bool UpdatePosition(Position const& pos, bool teleport = false) { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); }
|
||||
|
||||
void ProcessTerrainStatusUpdate() override;
|
||||
|
||||
@@ -2487,9 +2487,9 @@ public:
|
||||
[[nodiscard]] uint32 GetPendingBind() const { return _pendingBindId; }
|
||||
void SendRaidInfo();
|
||||
void SendSavedInstances();
|
||||
void PrettyPrintRequirementsQuestList(const std::vector<const ProgressionRequirement*>& missingQuests) const;
|
||||
void PrettyPrintRequirementsAchievementsList(const std::vector<const ProgressionRequirement*>& missingAchievements) const;
|
||||
void PrettyPrintRequirementsItemsList(const std::vector<const ProgressionRequirement*>& missingItems) const;
|
||||
void PrettyPrintRequirementsQuestList(std::vector<ProgressionRequirement const*> const& missingQuests) const;
|
||||
void PrettyPrintRequirementsAchievementsList(std::vector<ProgressionRequirement const*> const& missingAchievements) const;
|
||||
void PrettyPrintRequirementsItemsList(std::vector<ProgressionRequirement const*> const& missingItems) const;
|
||||
bool Satisfy(DungeonProgressionRequirements const* ar, uint32 target_map, bool report = false);
|
||||
bool CheckInstanceLoginValid();
|
||||
[[nodiscard]] bool CheckInstanceCount(uint32 instanceId) const;
|
||||
@@ -2513,7 +2513,7 @@ public:
|
||||
Group* GetGroupInvite() { return m_groupInvite; }
|
||||
void SetGroupInvite(Group* group) { m_groupInvite = group; }
|
||||
Group* GetGroup() { return m_group.getTarget(); }
|
||||
[[nodiscard]] const Group* GetGroup() const { return (const Group*)m_group.getTarget(); }
|
||||
[[nodiscard]] Group const* GetGroup() const { return (Group const*)m_group.getTarget(); }
|
||||
GroupReference& GetGroupRef() { return m_group; }
|
||||
void SetGroup(Group* group, int8 subgroup = -1);
|
||||
[[nodiscard]] uint8 GetSubGroup() const { return m_group.getSubGroup(); }
|
||||
@@ -2654,7 +2654,7 @@ public:
|
||||
[[nodiscard]] float GetRealParry() const { return m_realParry; }
|
||||
[[nodiscard]] float GetRealDodge() const { return m_realDodge; }
|
||||
// mt maps
|
||||
[[nodiscard]] const PlayerTalentMap& GetTalentMap() const { return m_talents; }
|
||||
[[nodiscard]] PlayerTalentMap const& GetTalentMap() const { return m_talents; }
|
||||
[[nodiscard]] uint32 GetNextSave() const { return m_nextSave; }
|
||||
[[nodiscard]] SpellModContainer const& GetSpellModList(uint32 type) const { return m_spellMods[type]; }
|
||||
|
||||
@@ -2698,7 +2698,7 @@ protected:
|
||||
|
||||
public:
|
||||
std::deque<PendingSpellCastRequest> SpellQueue;
|
||||
const PendingSpellCastRequest* GetCastRequest(uint32 category) const;
|
||||
PendingSpellCastRequest const* GetCastRequest(uint32 category) const;
|
||||
bool CanExecutePendingSpellCastRequest(SpellInfo const* spellInfo);
|
||||
void ExecuteOrCancelSpellCastRequest(PendingSpellCastRequest* castRequest, bool isCancel = false);
|
||||
bool CanRequestSpellCast(SpellInfo const* spellInfo);
|
||||
|
||||
@@ -288,7 +288,7 @@ bool Player::CanAddQuest(Quest const* quest, bool msg)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Player::CanCompleteQuest(uint32 quest_id, const QuestStatusData* q_savedStatus)
|
||||
bool Player::CanCompleteQuest(uint32 quest_id, QuestStatusData const* q_savedStatus)
|
||||
{
|
||||
if (quest_id)
|
||||
{
|
||||
@@ -2442,7 +2442,7 @@ void Player::SendCanTakeQuestResponse(QuestFailedReason msg) const
|
||||
LOG_DEBUG("network", "WORLD: Sent SMSG_QUESTGIVER_QUEST_INVALID");
|
||||
}
|
||||
|
||||
void Player::SendQuestConfirmAccept(const Quest* quest, Player* pReceiver)
|
||||
void Player::SendQuestConfirmAccept(Quest const* quest, Player* pReceiver)
|
||||
{
|
||||
if (pReceiver)
|
||||
{
|
||||
@@ -2451,7 +2451,7 @@ void Player::SendQuestConfirmAccept(const Quest* quest, Player* pReceiver)
|
||||
|
||||
int loc_idx = pReceiver->GetSession()->GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
if (const QuestLocale* pLocale = sObjectMgr->GetQuestLocale(quest->GetQuestId()))
|
||||
if (QuestLocale const* pLocale = sObjectMgr->GetQuestLocale(quest->GetQuestId()))
|
||||
ObjectMgr::GetLocaleString(pLocale->Title, loc_idx, strTitle);
|
||||
|
||||
WorldPackets::Quest::QuestConfirmAccept questConfirmAccept;
|
||||
|
||||
@@ -5211,7 +5211,7 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, CharacterDatabaseQueryHolder cons
|
||||
ResurrectPlayer(1.0f);
|
||||
}
|
||||
|
||||
const WorldLocation& _loc = GetEntryPoint();
|
||||
WorldLocation const& _loc = GetEntryPoint();
|
||||
mapId = _loc.GetMapId();
|
||||
instanceId = 0;
|
||||
|
||||
@@ -5703,7 +5703,7 @@ bool Player::isAllowedToLoot(Creature const* creature)
|
||||
if (HasPendingBind())
|
||||
return false;
|
||||
|
||||
const Loot* loot = &creature->loot;
|
||||
Loot const* loot = &creature->loot;
|
||||
if (loot->isLooted()) // nothing to loot or everything looted.
|
||||
return false;
|
||||
|
||||
@@ -6706,10 +6706,10 @@ void Player::SendSavedInstances()
|
||||
}
|
||||
}
|
||||
|
||||
void Player::PrettyPrintRequirementsQuestList(const std::vector<const ProgressionRequirement*>& missingQuests) const
|
||||
void Player::PrettyPrintRequirementsQuestList(std::vector<ProgressionRequirement const*> const& missingQuests) const
|
||||
{
|
||||
LocaleConstant loc_idx = GetSession()->GetSessionDbLocaleIndex();
|
||||
for (const ProgressionRequirement* missingReq : missingQuests)
|
||||
for (ProgressionRequirement const* missingReq : missingQuests)
|
||||
{
|
||||
Quest const* questTemplate = sObjectMgr->GetQuestTemplate(missingReq->id);
|
||||
if (!questTemplate)
|
||||
@@ -6743,10 +6743,10 @@ void Player::PrettyPrintRequirementsQuestList(const std::vector<const Progressio
|
||||
}
|
||||
}
|
||||
|
||||
void Player::PrettyPrintRequirementsAchievementsList(const std::vector<const ProgressionRequirement*>& missingAchievements) const
|
||||
void Player::PrettyPrintRequirementsAchievementsList(std::vector<ProgressionRequirement const*> const& missingAchievements) const
|
||||
{
|
||||
LocaleConstant loc_idx = GetSession()->GetSessionDbLocaleIndex();
|
||||
for (const ProgressionRequirement* missingReq : missingAchievements)
|
||||
for (ProgressionRequirement const* missingReq : missingAchievements)
|
||||
{
|
||||
AchievementEntry const* achievementEntry = sAchievementStore.LookupEntry(missingReq->id);
|
||||
if (!achievementEntry)
|
||||
@@ -6776,10 +6776,10 @@ void Player::PrettyPrintRequirementsAchievementsList(const std::vector<const Pro
|
||||
}
|
||||
}
|
||||
|
||||
void Player::PrettyPrintRequirementsItemsList(const std::vector<const ProgressionRequirement*>& missingItems) const
|
||||
void Player::PrettyPrintRequirementsItemsList(std::vector<ProgressionRequirement const*> const& missingItems) const
|
||||
{
|
||||
LocaleConstant loc_idx = GetSession()->GetSessionDbLocaleIndex();
|
||||
for (const ProgressionRequirement* missingReq : missingItems)
|
||||
for (ProgressionRequirement const* missingReq : missingItems)
|
||||
{
|
||||
ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(missingReq->id);
|
||||
if (!itemTemplate)
|
||||
@@ -6855,12 +6855,12 @@ bool Player::Satisfy(DungeonProgressionRequirements const* ar, uint32 target_map
|
||||
}
|
||||
|
||||
//Check all items
|
||||
std::vector<const ProgressionRequirement*> missingPlayerItems;
|
||||
std::vector<const ProgressionRequirement*> missingLeaderItems;
|
||||
for (const ProgressionRequirement* itemRequirement : ar->items)
|
||||
std::vector<ProgressionRequirement const*> missingPlayerItems;
|
||||
std::vector<ProgressionRequirement const*> missingLeaderItems;
|
||||
for (ProgressionRequirement const* itemRequirement : ar->items)
|
||||
{
|
||||
Player* checkPlayer = this;
|
||||
std::vector<const ProgressionRequirement*>* missingItems = &missingPlayerItems;
|
||||
std::vector<ProgressionRequirement const*>* missingItems = &missingPlayerItems;
|
||||
if (itemRequirement->checkLeaderOnly)
|
||||
{
|
||||
checkPlayer = partyLeader;
|
||||
@@ -6877,12 +6877,12 @@ bool Player::Satisfy(DungeonProgressionRequirements const* ar, uint32 target_map
|
||||
}
|
||||
|
||||
//Check all achievements
|
||||
std::vector<const ProgressionRequirement*> missingPlayerAchievements;
|
||||
std::vector<const ProgressionRequirement*> missingLeaderAchievements;
|
||||
for (const ProgressionRequirement* achievementRequirement : ar->achievements)
|
||||
std::vector<ProgressionRequirement const*> missingPlayerAchievements;
|
||||
std::vector<ProgressionRequirement const*> missingLeaderAchievements;
|
||||
for (ProgressionRequirement const* achievementRequirement : ar->achievements)
|
||||
{
|
||||
Player* checkPlayer = this;
|
||||
std::vector<const ProgressionRequirement*>* missingAchievements = &missingPlayerAchievements;
|
||||
std::vector<ProgressionRequirement const*>* missingAchievements = &missingPlayerAchievements;
|
||||
if (achievementRequirement->checkLeaderOnly)
|
||||
{
|
||||
checkPlayer = partyLeader;
|
||||
@@ -6899,12 +6899,12 @@ bool Player::Satisfy(DungeonProgressionRequirements const* ar, uint32 target_map
|
||||
}
|
||||
|
||||
//Check all quests
|
||||
std::vector<const ProgressionRequirement*> missingPlayerQuests;
|
||||
std::vector<const ProgressionRequirement*> missingLeaderQuests;
|
||||
for (const ProgressionRequirement* questRequirement : ar->quests)
|
||||
std::vector<ProgressionRequirement const*> missingPlayerQuests;
|
||||
std::vector<ProgressionRequirement const*> missingLeaderQuests;
|
||||
for (ProgressionRequirement const* questRequirement : ar->quests)
|
||||
{
|
||||
Player* checkPlayer = this;
|
||||
std::vector<const ProgressionRequirement*>* missingQuests = &missingPlayerQuests;
|
||||
std::vector<ProgressionRequirement const*>* missingQuests = &missingPlayerQuests;
|
||||
if (questRequirement->checkLeaderOnly)
|
||||
{
|
||||
checkPlayer = partyLeader;
|
||||
|
||||
@@ -127,7 +127,7 @@ void PlayerTaxi::AppendTaximaskTo(ByteBuffer& data, bool all)
|
||||
}
|
||||
}
|
||||
|
||||
bool PlayerTaxi::LoadTaxiDestinationsFromString(const std::string& values, TeamId teamId)
|
||||
bool PlayerTaxi::LoadTaxiDestinationsFromString(std::string const& values, TeamId teamId)
|
||||
{
|
||||
ClearTaxiDestinations();
|
||||
|
||||
|
||||
@@ -2323,9 +2323,9 @@ bool Player::CanExecutePendingSpellCastRequest(SpellInfo const* spellInfo)
|
||||
return true;
|
||||
}
|
||||
|
||||
const PendingSpellCastRequest* Player::GetCastRequest(uint32 category) const
|
||||
PendingSpellCastRequest const* Player::GetCastRequest(uint32 category) const
|
||||
{
|
||||
for (const PendingSpellCastRequest& request : SpellQueue)
|
||||
for (PendingSpellCastRequest const& request : SpellQueue)
|
||||
if (request.category == category)
|
||||
return &request;
|
||||
return nullptr;
|
||||
|
||||
@@ -246,7 +246,7 @@ void CharmInfo::SetPetNumber(uint32 petnumber, bool statwindow)
|
||||
_unit->SetUInt32Value(UNIT_FIELD_PETNUMBER, 0);
|
||||
}
|
||||
|
||||
void CharmInfo::LoadPetActionBar(const std::string& data)
|
||||
void CharmInfo::LoadPetActionBar(std::string const& data)
|
||||
{
|
||||
std::vector<std::string_view> tokens = Acore::Tokenize(data, ' ', false);
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ public:
|
||||
//return true if successful
|
||||
bool AddSpellToActionBar(SpellInfo const* spellInfo, ActiveStates newstate = ACT_DECIDE, uint32 index = MAX_UNIT_ACTION_BAR_INDEX + 1);
|
||||
bool RemoveSpellFromActionBar(uint32 spell_id);
|
||||
void LoadPetActionBar(const std::string& data);
|
||||
void LoadPetActionBar(std::string const& data);
|
||||
void BuildActionBar(WorldPacket* data);
|
||||
void SetSpellAutocast(SpellInfo const* spellInfo, bool state);
|
||||
void SetActionBar(uint8 index, uint32 spellOrAction, ActiveStates type)
|
||||
|
||||
@@ -816,7 +816,7 @@ bool Unit::IsWithinRange(Unit const* obj, float dist) const
|
||||
return distsq <= dist * dist;
|
||||
}
|
||||
|
||||
bool Unit::IsWithinBoundaryRadius(const Unit* obj) const
|
||||
bool Unit::IsWithinBoundaryRadius(Unit const* obj) const
|
||||
{
|
||||
if (!obj || !IsInMap(obj) || !InSamePhase(obj))
|
||||
return false;
|
||||
@@ -5231,7 +5231,7 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId
|
||||
{
|
||||
noxious->SetDuration(aura->GetDuration() * aureff->GetAmount() / 100);
|
||||
if (aura->GetUnitOwner())
|
||||
if (const std::vector<int32>* spell_triggered = sSpellMgr->GetSpellLinked(-int32(aura->GetId())))
|
||||
if (std::vector<int32> const* spell_triggered = sSpellMgr->GetSpellLinked(-int32(aura->GetId())))
|
||||
for (std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
|
||||
aura->GetUnitOwner()->RemoveAurasDueToSpell(*itr);
|
||||
}
|
||||
@@ -14442,7 +14442,7 @@ void Unit::SetRooted(bool apply, bool stun, bool logout)
|
||||
|
||||
void Unit::SendMoveRoot(bool apply)
|
||||
{
|
||||
const Player* client = GetClientControlling();
|
||||
Player const* client = GetClientControlling();
|
||||
|
||||
// Apply flags in-place when unit currently is not controlled by a player
|
||||
if (!client)
|
||||
@@ -14461,7 +14461,7 @@ void Unit::SendMoveRoot(bool apply)
|
||||
if (!IsInWorld())
|
||||
return;
|
||||
|
||||
const PackedGuid& guid = GetPackGUID();
|
||||
PackedGuid const& guid = GetPackGUID();
|
||||
// Wrath+ spline root: when unit is currently not controlled by a player
|
||||
if (!client)
|
||||
{
|
||||
|
||||
@@ -730,7 +730,7 @@ public:
|
||||
Pet* ToPet() { if (IsPet()) return reinterpret_cast<Pet*>(this); else return nullptr; }
|
||||
Totem* ToTotem() { if (IsTotem()) return reinterpret_cast<Totem*>(this); else return nullptr; }
|
||||
TempSummon* ToTempSummon() { if (IsSummon()) return reinterpret_cast<TempSummon*>(this); else return nullptr; }
|
||||
[[nodiscard]] const TempSummon* ToTempSummon() const { if (IsSummon()) return reinterpret_cast<const TempSummon*>(this); else return nullptr; }
|
||||
[[nodiscard]] TempSummon const* ToTempSummon() const { if (IsSummon()) return reinterpret_cast<TempSummon const*>(this); else return nullptr; }
|
||||
|
||||
// Unit state
|
||||
void AddUnitState(uint32 f) { m_state |= f; }
|
||||
@@ -878,7 +878,7 @@ public:
|
||||
[[nodiscard]] float GetCombatReach() const override { return m_floatValues[UNIT_FIELD_COMBATREACH]; }
|
||||
[[nodiscard]] float GetMeleeReach() const { float reach = m_floatValues[UNIT_FIELD_COMBATREACH]; return reach > MIN_MELEE_REACH ? reach : MIN_MELEE_REACH; }
|
||||
[[nodiscard]] bool IsWithinRange(Unit const* obj, float dist) const;
|
||||
bool IsWithinBoundaryRadius(const Unit* obj) const;
|
||||
bool IsWithinBoundaryRadius(Unit const* obj) const;
|
||||
bool IsWithinCombatRange(Unit const* obj, float dist2compare) const;
|
||||
bool IsWithinMeleeRange(Unit const* obj, float dist = 0.f) const;
|
||||
float GetMeleeRange(Unit const* target) const;
|
||||
@@ -1524,7 +1524,7 @@ public:
|
||||
|
||||
[[nodiscard]] int32 GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const;
|
||||
[[nodiscard]] float GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask) const;
|
||||
[[nodiscard]] int32 GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask, const AuraEffect* except = nullptr) const;
|
||||
[[nodiscard]] int32 GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask, AuraEffect const* except = nullptr) const;
|
||||
[[nodiscard]] int32 GetMaxNegativeAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const;
|
||||
|
||||
[[nodiscard]] int32 GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const;
|
||||
@@ -1754,7 +1754,7 @@ public:
|
||||
void SetHover(bool enable);
|
||||
|
||||
MotionMaster* GetMotionMaster() { return i_motionMaster; }
|
||||
[[nodiscard]] const MotionMaster* GetMotionMaster() const { return i_motionMaster; }
|
||||
[[nodiscard]] MotionMaster const* GetMotionMaster() const { return i_motionMaster; }
|
||||
[[nodiscard]] virtual MovementGeneratorType GetDefaultMovementType() const;
|
||||
|
||||
[[nodiscard]] bool IsStopped() const { return !(HasUnitState(UNIT_STATE_MOVING)); }
|
||||
@@ -2002,7 +2002,7 @@ public:
|
||||
void UpdateHeight(float newZ);
|
||||
|
||||
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport = false);
|
||||
bool UpdatePosition(const Position& pos, bool teleport = false) { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); }
|
||||
bool UpdatePosition(Position const& pos, bool teleport = false) { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); }
|
||||
|
||||
void ProcessPositionDataChanged(PositionFullTerrainStatus const& data) override;
|
||||
virtual void ProcessTerrainStatusUpdate();
|
||||
|
||||
@@ -19,22 +19,22 @@ class MMapTargetData
|
||||
{
|
||||
public:
|
||||
MMapTargetData() = default;
|
||||
MMapTargetData(uint32 endTime, const Position* o, const Position* t)
|
||||
MMapTargetData(uint32 endTime, Position const* o, Position const* t)
|
||||
{
|
||||
_endTime = endTime;
|
||||
_posOwner.Relocate(o);
|
||||
_posTarget.Relocate(t);
|
||||
}
|
||||
MMapTargetData(const MMapTargetData& c)
|
||||
MMapTargetData(MMapTargetData const& c)
|
||||
{
|
||||
_endTime = c._endTime;
|
||||
_posOwner.Relocate(c._posOwner);
|
||||
_posTarget.Relocate(c._posTarget);
|
||||
}
|
||||
MMapTargetData(MMapTargetData&&) = default;
|
||||
MMapTargetData& operator=(const MMapTargetData&) = default;
|
||||
MMapTargetData& operator=(MMapTargetData const&) = default;
|
||||
MMapTargetData& operator=(MMapTargetData&&) = default;
|
||||
[[nodiscard]] bool PosChanged(const Position& o, const Position& t) const
|
||||
[[nodiscard]] bool PosChanged(Position const& o, Position const& t) const
|
||||
{
|
||||
return _posOwner.GetExactDistSq(&o) > 0.5f * 0.5f || _posTarget.GetExactDistSq(&t) > 0.5f * 0.5f;
|
||||
}
|
||||
@@ -47,7 +47,7 @@ class SafeUnitPointer
|
||||
{
|
||||
public:
|
||||
explicit SafeUnitPointer(Unit* defVal) : ptr(defVal), defaultValue(defVal) {}
|
||||
SafeUnitPointer(const SafeUnitPointer& /*p*/) { ABORT(); }
|
||||
SafeUnitPointer(SafeUnitPointer const& /*p*/) { ABORT(); }
|
||||
void Initialize(Unit* defVal) { defaultValue = defVal; ptr = defVal; }
|
||||
~SafeUnitPointer();
|
||||
void SetPointedTo(Unit* u);
|
||||
|
||||
@@ -143,7 +143,7 @@ static const std::vector<HolidayRule> HolidayRules = {
|
||||
{ HOLIDAY_DARKMOON_FAIRE_SHATTRATH, HolidayCalculationType::DARKMOON_FAIRE, 2, 0, 0, -2 } // Feb, May, Aug, Nov
|
||||
};
|
||||
|
||||
const std::vector<HolidayRule>& HolidayDateCalculator::GetHolidayRules()
|
||||
std::vector<HolidayRule> const& HolidayDateCalculator::GetHolidayRules()
|
||||
{
|
||||
return HolidayRules;
|
||||
}
|
||||
@@ -479,7 +479,7 @@ std::tm HolidayDateCalculator::CalculateWinterSolstice(int year)
|
||||
return result;
|
||||
}
|
||||
|
||||
std::tm HolidayDateCalculator::CalculateHolidayDate(const HolidayRule& rule, int year)
|
||||
std::tm HolidayDateCalculator::CalculateHolidayDate(HolidayRule const& rule, int year)
|
||||
{
|
||||
std::tm result = {};
|
||||
|
||||
@@ -572,7 +572,7 @@ std::tm HolidayDateCalculator::CalculateHolidayDate(const HolidayRule& rule, int
|
||||
return result;
|
||||
}
|
||||
|
||||
uint32_t HolidayDateCalculator::PackDate(const std::tm& date)
|
||||
uint32_t HolidayDateCalculator::PackDate(std::tm const& date)
|
||||
{
|
||||
// WoW packed date format (same as ByteBuffer::AppendPackedTime):
|
||||
// bits 24-28: year offset from 2000 (5 bits = 0-31, valid years 2000-2031)
|
||||
@@ -648,7 +648,7 @@ std::vector<uint32_t> HolidayDateCalculator::GetDarkmoonFaireDates(int locationO
|
||||
return dates;
|
||||
}
|
||||
|
||||
time_t HolidayDateCalculator::FindStartTimeForStage(const uint32_t* packedDates, uint8_t numDates,
|
||||
time_t HolidayDateCalculator::FindStartTimeForStage(uint32_t const* packedDates, uint8_t numDates,
|
||||
time_t stageOffset, uint32_t stageLengthMinutes, time_t curTime)
|
||||
{
|
||||
for (uint8_t i = 0; i < numDates && packedDates[i]; ++i)
|
||||
|
||||
@@ -80,16 +80,16 @@ public:
|
||||
static std::tm CalculateWinterSolstice(int year);
|
||||
|
||||
// Calculate holiday start date for a given year
|
||||
static std::tm CalculateHolidayDate(const HolidayRule& rule, int year);
|
||||
static std::tm CalculateHolidayDate(HolidayRule const& rule, int year);
|
||||
|
||||
// Convert std::tm to WoW's packed date format
|
||||
static uint32_t PackDate(const std::tm& date);
|
||||
static uint32_t PackDate(std::tm const& date);
|
||||
|
||||
// Convert WoW's packed date format to std::tm
|
||||
static std::tm UnpackDate(uint32_t packed);
|
||||
|
||||
// Get all holiday rules
|
||||
static const std::vector<HolidayRule>& GetHolidayRules();
|
||||
static std::vector<HolidayRule> const& GetHolidayRules();
|
||||
|
||||
// Calculate date for a specific holiday ID and year
|
||||
static uint32_t GetPackedHolidayDate(uint32_t holidayId, int year);
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
// For multi-stage holidays, stageOffset is the cumulative duration (in seconds) of all prior stages.
|
||||
// stageLengthMinutes is the duration of the current stage in minutes.
|
||||
// Returns the computed stage start time (startTime + stageOffset), or 0 if no valid date found.
|
||||
static time_t FindStartTimeForStage(const uint32_t* packedDates, uint8_t numDates,
|
||||
static time_t FindStartTimeForStage(uint32_t const* packedDates, uint8_t numDates,
|
||||
time_t stageOffset, uint32_t stageLengthMinutes, time_t curTime);
|
||||
|
||||
// Start time for a looping holiday event (Battleground Call to Arms): rolls the packed anchor
|
||||
|
||||
@@ -1381,7 +1381,7 @@ void ObjectMgr::LoadGameObjectAddons()
|
||||
|
||||
ObjectGuid::LowType guid = fields[0].Get<uint32>();
|
||||
|
||||
const GameObjectData* goData = GetGameObjectData(guid);
|
||||
GameObjectData const* goData = GetGameObjectData(guid);
|
||||
if (!goData)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "GameObject (GUID: {}) does not exist but has a record in `gameobject_addon`", guid);
|
||||
@@ -1656,7 +1656,7 @@ CreatureModel const* ObjectMgr::ChooseDisplayId(CreatureTemplate const* cinfo, C
|
||||
return cinfo->GetFirstInvisibleModel();
|
||||
}
|
||||
|
||||
void ObjectMgr::ChooseCreatureFlags(const CreatureTemplate* cinfo, uint32& npcflag, uint32& unit_flags, uint32& dynamicflags, const CreatureData* data /*= nullptr*/)
|
||||
void ObjectMgr::ChooseCreatureFlags(CreatureTemplate const* cinfo, uint32& npcflag, uint32& unit_flags, uint32& dynamicflags, CreatureData const* data /*= nullptr*/)
|
||||
{
|
||||
npcflag = cinfo->npcflag;
|
||||
unit_flags = cinfo->unit_flags;
|
||||
@@ -1947,7 +1947,7 @@ void ObjectMgr::LoadLinkedRespawn()
|
||||
{
|
||||
case CREATURE_TO_CREATURE:
|
||||
{
|
||||
const CreatureData* slave = GetCreatureData(guidLow);
|
||||
CreatureData const* slave = GetCreatureData(guidLow);
|
||||
if (!slave)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "LinkedRespawn: Creature (guid) {} not found in creature table", guidLow);
|
||||
@@ -1955,7 +1955,7 @@ void ObjectMgr::LoadLinkedRespawn()
|
||||
break;
|
||||
}
|
||||
|
||||
const CreatureData* master = GetCreatureData(linkedGuidLow);
|
||||
CreatureData const* master = GetCreatureData(linkedGuidLow);
|
||||
if (!master)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "LinkedRespawn: Creature (linkedGuid) {} not found in creature table", linkedGuidLow);
|
||||
@@ -1984,7 +1984,7 @@ void ObjectMgr::LoadLinkedRespawn()
|
||||
}
|
||||
case CREATURE_TO_GO:
|
||||
{
|
||||
const CreatureData* slave = GetCreatureData(guidLow);
|
||||
CreatureData const* slave = GetCreatureData(guidLow);
|
||||
if (!slave)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "LinkedRespawn: Creature (guid) {} not found in creature table", guidLow);
|
||||
@@ -1992,7 +1992,7 @@ void ObjectMgr::LoadLinkedRespawn()
|
||||
break;
|
||||
}
|
||||
|
||||
const GameObjectData* master = GetGameObjectData(linkedGuidLow);
|
||||
GameObjectData const* master = GetGameObjectData(linkedGuidLow);
|
||||
if (!master)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "LinkedRespawn: Gameobject (linkedGuid) {} not found in gameobject table", linkedGuidLow);
|
||||
@@ -2021,7 +2021,7 @@ void ObjectMgr::LoadLinkedRespawn()
|
||||
}
|
||||
case GO_TO_GO:
|
||||
{
|
||||
const GameObjectData* slave = GetGameObjectData(guidLow);
|
||||
GameObjectData const* slave = GetGameObjectData(guidLow);
|
||||
if (!slave)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "LinkedRespawn: Gameobject (guid) {} not found in gameobject table", guidLow);
|
||||
@@ -2029,7 +2029,7 @@ void ObjectMgr::LoadLinkedRespawn()
|
||||
break;
|
||||
}
|
||||
|
||||
const GameObjectData* master = GetGameObjectData(linkedGuidLow);
|
||||
GameObjectData const* master = GetGameObjectData(linkedGuidLow);
|
||||
if (!master)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "LinkedRespawn: Gameobject (linkedGuid) {} not found in gameobject table", linkedGuidLow);
|
||||
@@ -2058,7 +2058,7 @@ void ObjectMgr::LoadLinkedRespawn()
|
||||
}
|
||||
case GO_TO_CREATURE:
|
||||
{
|
||||
const GameObjectData* slave = GetGameObjectData(guidLow);
|
||||
GameObjectData const* slave = GetGameObjectData(guidLow);
|
||||
if (!slave)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "LinkedRespawn: Gameobject (guid) {} not found in gameobject table", guidLow);
|
||||
@@ -2066,7 +2066,7 @@ void ObjectMgr::LoadLinkedRespawn()
|
||||
break;
|
||||
}
|
||||
|
||||
const CreatureData* master = GetCreatureData(linkedGuidLow);
|
||||
CreatureData const* master = GetCreatureData(linkedGuidLow);
|
||||
if (!master)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "LinkedRespawn: Creature (linkedGuid) {} not found in creature table", linkedGuidLow);
|
||||
@@ -7623,7 +7623,7 @@ void ObjectMgr::LoadAccessRequirements()
|
||||
}
|
||||
|
||||
//Sort all arrays for priority
|
||||
auto sortFunction = [](const ProgressionRequirement* const a, const ProgressionRequirement* const b) {return a->priority > b->priority; };
|
||||
auto sortFunction = [](ProgressionRequirement const* const a, ProgressionRequirement const* const b) {return a->priority > b->priority; };
|
||||
std::sort(ar->achievements.begin(), ar->achievements.end(), sortFunction);
|
||||
std::sort(ar->quests.begin(), ar->quests.end(), sortFunction);
|
||||
std::sort(ar->items.begin(), ar->items.end(), sortFunction);
|
||||
@@ -9464,7 +9464,7 @@ bool ObjectMgr::IsValidCharterName(std::string_view name)
|
||||
return isValidString(wname, strictMask, true);
|
||||
}
|
||||
|
||||
bool ObjectMgr::IsValidChannelName(const std::string& name)
|
||||
bool ObjectMgr::IsValidChannelName(std::string const& name)
|
||||
{
|
||||
std::wstring wname;
|
||||
if (!Utf8toWStr(name, wname))
|
||||
@@ -9927,7 +9927,7 @@ GameTele const* ObjectMgr::GetGameTele(std::string_view name, bool exactSearch)
|
||||
wstrToLower(wname);
|
||||
|
||||
// Alternative first GameTele what contains wnameLow as substring in case no GameTele location found
|
||||
const GameTele* alt = nullptr;
|
||||
GameTele const* alt = nullptr;
|
||||
for (GameTeleContainer::const_iterator itr = _gameTeleStore.begin(); itr != _gameTeleStore.end(); ++itr)
|
||||
{
|
||||
if (itr->second.wnameLow == wname)
|
||||
|
||||
@@ -1172,7 +1172,7 @@ public:
|
||||
if (map_itr == _mailLevelRewardStore.end())
|
||||
return nullptr;
|
||||
|
||||
for (const auto & set_itr : map_itr->second)
|
||||
for (auto const& set_itr : map_itr->second)
|
||||
if (set_itr.raceMask & raceMask)
|
||||
return &set_itr;
|
||||
|
||||
@@ -1496,7 +1496,7 @@ public:
|
||||
else
|
||||
return {};
|
||||
}
|
||||
static inline void GetLocaleString(const std::vector<std::string>& data, int loc_idx, std::string& value)
|
||||
static inline void GetLocaleString(std::vector<std::string> const& data, int loc_idx, std::string& value)
|
||||
{
|
||||
if (data.size() > std::size_t(loc_idx) && !data[loc_idx].empty())
|
||||
value = data[loc_idx];
|
||||
|
||||
@@ -54,13 +54,13 @@ struct Cell
|
||||
y = data.Part.grid_y * MAX_NUMBER_OF_CELLS + data.Part.cell_y;
|
||||
}
|
||||
|
||||
[[nodiscard]] bool DiffCell(const Cell& cell) const
|
||||
[[nodiscard]] bool DiffCell(Cell const& cell) const
|
||||
{
|
||||
return(data.Part.cell_x != cell.data.Part.cell_x ||
|
||||
data.Part.cell_y != cell.data.Part.cell_y);
|
||||
}
|
||||
|
||||
[[nodiscard]] bool DiffGrid(const Cell& cell) const
|
||||
[[nodiscard]] bool DiffGrid(Cell const& cell) const
|
||||
{
|
||||
return(data.Part.grid_x != cell.data.Part.grid_x ||
|
||||
data.Part.grid_y != cell.data.Part.grid_y);
|
||||
|
||||
@@ -91,12 +91,12 @@ struct CoordPair
|
||||
, y_coord(y)
|
||||
{}
|
||||
|
||||
CoordPair(const CoordPair<LIMIT>& obj)
|
||||
CoordPair(CoordPair<LIMIT> const& obj)
|
||||
: x_coord(obj.x_coord)
|
||||
, y_coord(obj.y_coord)
|
||||
{}
|
||||
|
||||
CoordPair<LIMIT>& operator=(const CoordPair<LIMIT>& obj)
|
||||
CoordPair<LIMIT>& operator=(CoordPair<LIMIT> const& obj)
|
||||
{
|
||||
x_coord = obj.x_coord;
|
||||
y_coord = obj.y_coord;
|
||||
@@ -157,13 +157,13 @@ struct CoordPair
|
||||
};
|
||||
|
||||
template<uint32 LIMIT>
|
||||
bool operator==(const CoordPair<LIMIT>& p1, const CoordPair<LIMIT>& p2)
|
||||
bool operator==(CoordPair<LIMIT> const& p1, CoordPair<LIMIT> const& p2)
|
||||
{
|
||||
return (p1.x_coord == p2.x_coord && p1.y_coord == p2.y_coord);
|
||||
}
|
||||
|
||||
template<uint32 LIMIT>
|
||||
bool operator!=(const CoordPair<LIMIT>& p1, const CoordPair<LIMIT>& p2)
|
||||
bool operator!=(CoordPair<LIMIT> const& p1, CoordPair<LIMIT> const& p2)
|
||||
{
|
||||
return !(p1 == p2);
|
||||
}
|
||||
|
||||
@@ -411,7 +411,7 @@ Player* Group::GetInvited(ObjectGuid guid) const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Player* Group::GetInvited(const std::string& name) const
|
||||
Player* Group::GetInvited(std::string const& name) const
|
||||
{
|
||||
for (InvitesList::const_iterator itr = m_invitees.begin(); itr != m_invitees.end(); ++itr)
|
||||
{
|
||||
@@ -577,7 +577,7 @@ bool Group::AddMember(Player* player, uint8 roles /* = 0 */)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Group::RemoveMember(ObjectGuid guid, const RemoveMethod& method /*= GROUP_REMOVEMETHOD_DEFAULT*/, ObjectGuid kicker /*= ObjectGuid::Empty*/, const char* reason /*= nullptr*/)
|
||||
bool Group::RemoveMember(ObjectGuid guid, RemoveMethod const& method /*= GROUP_REMOVEMETHOD_DEFAULT*/, ObjectGuid kicker /*= ObjectGuid::Empty*/, char const* reason /*= nullptr*/)
|
||||
{
|
||||
BroadcastGroupUpdate();
|
||||
|
||||
@@ -856,7 +856,7 @@ void Group::Disband(bool hideDestroy /* = false */)
|
||||
/*** LOOT SYSTEM ***/
|
||||
/*********************************************************/
|
||||
|
||||
void Group::SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll& r)
|
||||
void Group::SendLootStartRoll(uint32 CountDown, uint32 mapid, Roll const& r)
|
||||
{
|
||||
WorldPacket data(SMSG_LOOT_START_ROLL, (8 + 4 + 4 + 4 + 4 + 4 + 4 + 1));
|
||||
data << r.itemGUID; // guid of rolled item
|
||||
@@ -1736,7 +1736,7 @@ void Group::CountTheRoll(Rolls::iterator rollI)
|
||||
|
||||
if (Loot* loot = roll->getLoot(); loot && loot->isLooted() && loot->sourceGameObject)
|
||||
{
|
||||
const GameObjectTemplate* goInfo = loot->sourceGameObject->GetGOInfo();
|
||||
GameObjectTemplate const* goInfo = loot->sourceGameObject->GetGOInfo();
|
||||
if (goInfo && goInfo->type == GAMEOBJECT_TYPE_CHEST)
|
||||
{
|
||||
// Deactivate chest if the last item was rolled in group
|
||||
@@ -2445,7 +2445,7 @@ ObjectGuid Group::GetGUID() const
|
||||
return m_guid;
|
||||
}
|
||||
|
||||
const char* Group::GetLeaderName() const
|
||||
char const* Group::GetLeaderName() const
|
||||
{
|
||||
return m_leaderName.c_str();
|
||||
}
|
||||
@@ -2480,7 +2480,7 @@ bool Group::IsLeader(ObjectGuid guid) const
|
||||
return (GetLeaderGUID() == guid);
|
||||
}
|
||||
|
||||
ObjectGuid Group::GetMemberGUID(const std::string& name)
|
||||
ObjectGuid Group::GetMemberGUID(std::string const& name)
|
||||
{
|
||||
for (member_citerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr)
|
||||
if (itr->name == name)
|
||||
|
||||
@@ -205,7 +205,7 @@ public:
|
||||
void RemoveAllInvites();
|
||||
bool AddLeaderInvite(Player* player);
|
||||
bool AddMember(Player* player, uint8 roles = 0);
|
||||
bool RemoveMember(ObjectGuid guid, const RemoveMethod& method = GROUP_REMOVEMETHOD_DEFAULT, ObjectGuid kicker = ObjectGuid::Empty, const char* reason = nullptr);
|
||||
bool RemoveMember(ObjectGuid guid, RemoveMethod const& method = GROUP_REMOVEMETHOD_DEFAULT, ObjectGuid kicker = ObjectGuid::Empty, char const* reason = nullptr);
|
||||
void ChangeLeader(ObjectGuid guid);
|
||||
void SetLootMethod(LootMethod method);
|
||||
void SetLooterGuid(ObjectGuid guid);
|
||||
@@ -226,7 +226,7 @@ public:
|
||||
ObjectGuid GetLeaderGUID() const;
|
||||
Player* GetLeader();
|
||||
ObjectGuid GetGUID() const;
|
||||
const char* GetLeaderName() const;
|
||||
char const* GetLeaderName() const;
|
||||
LootMethod GetLootMethod() const;
|
||||
ObjectGuid GetLooterGuid() const;
|
||||
ObjectGuid GetMasterLooterGuid() const;
|
||||
@@ -235,11 +235,11 @@ public:
|
||||
// member manipulation methods
|
||||
bool IsMember(ObjectGuid guid) const;
|
||||
bool IsLeader(ObjectGuid guid) const;
|
||||
ObjectGuid GetMemberGUID(const std::string& name);
|
||||
ObjectGuid GetMemberGUID(std::string const& name);
|
||||
bool IsAssistant(ObjectGuid guid) const;
|
||||
|
||||
Player* GetInvited(ObjectGuid guid) const;
|
||||
Player* GetInvited(const std::string& name) const;
|
||||
Player* GetInvited(std::string const& name) const;
|
||||
|
||||
bool SameSubGroup(ObjectGuid guid1, ObjectGuid guid2) const;
|
||||
bool SameSubGroup(ObjectGuid guid1, MemberSlot const* slot2) const;
|
||||
@@ -293,11 +293,11 @@ public:
|
||||
/*********************************************************/
|
||||
|
||||
bool isRollLootActive() const;
|
||||
void SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll& r);
|
||||
void SendLootStartRoll(uint32 CountDown, uint32 mapid, Roll const& r);
|
||||
void SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p, bool canNeed, Roll const& r);
|
||||
void SendPendingRollsToPlayer(Player* player, Map* map);
|
||||
void SendLootRoll(ObjectGuid SourceGuid, ObjectGuid TargetGuid, uint8 RollNumber, uint8 RollType, const Roll& r, bool autoPass = false);
|
||||
void SendLootRollWon(ObjectGuid SourceGuid, ObjectGuid TargetGuid, uint8 RollNumber, uint8 RollType, const Roll& r);
|
||||
void SendLootRoll(ObjectGuid SourceGuid, ObjectGuid TargetGuid, uint8 RollNumber, uint8 RollType, Roll const& r, bool autoPass = false);
|
||||
void SendLootRollWon(ObjectGuid SourceGuid, ObjectGuid TargetGuid, uint8 RollNumber, uint8 RollType, Roll const& r);
|
||||
void SendLootAllPassed(Roll const& roll);
|
||||
void SendLooter(Creature* creature, Player* pLooter);
|
||||
void GroupLoot(Loot* loot, WorldObject* pLootedObject);
|
||||
|
||||
@@ -1319,7 +1319,7 @@ void Guild::HandleSetInfo(WorldSession* session, std::string_view info)
|
||||
}
|
||||
}
|
||||
|
||||
void Guild::HandleSetEmblem(WorldSession* session, const EmblemInfo& emblemInfo)
|
||||
void Guild::HandleSetEmblem(WorldSession* session, EmblemInfo const& emblemInfo)
|
||||
{
|
||||
Player* player = session->GetPlayer();
|
||||
if (!_IsLeader(player))
|
||||
@@ -2483,7 +2483,7 @@ bool Guild::_IsLeader(Player* player) const
|
||||
{
|
||||
if (player->GetGUID() == m_leaderGuid)
|
||||
return true;
|
||||
if (const Member* member = GetMember(player->GetGUID()))
|
||||
if (Member const* member = GetMember(player->GetGUID()))
|
||||
return member->IsRank(GR_GUILDMASTER);
|
||||
return false;
|
||||
}
|
||||
@@ -2544,21 +2544,21 @@ void Guild::_SetRankBankTabRightsAndSlots(uint8 rankId, GuildBankRightsAndSlots
|
||||
|
||||
inline std::string Guild::_GetRankName(uint8 rankId) const
|
||||
{
|
||||
if (const RankInfo* rankInfo = GetRankInfo(rankId))
|
||||
if (RankInfo const* rankInfo = GetRankInfo(rankId))
|
||||
return rankInfo->GetName();
|
||||
return "<unknown>";
|
||||
}
|
||||
|
||||
inline uint32 Guild::_GetRankRights(uint8 rankId) const
|
||||
{
|
||||
if (const RankInfo* rankInfo = GetRankInfo(rankId))
|
||||
if (RankInfo const* rankInfo = GetRankInfo(rankId))
|
||||
return rankInfo->GetRights();
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline int32 Guild::_GetRankBankMoneyPerDay(uint8 rankId) const
|
||||
{
|
||||
if (const RankInfo* rankInfo = GetRankInfo(rankId))
|
||||
if (RankInfo const* rankInfo = GetRankInfo(rankId))
|
||||
return rankInfo->GetBankMoneyPerDay();
|
||||
return 0;
|
||||
}
|
||||
@@ -2566,14 +2566,14 @@ inline int32 Guild::_GetRankBankMoneyPerDay(uint8 rankId) const
|
||||
inline int32 Guild::_GetRankBankTabSlotsPerDay(uint8 rankId, uint8 tabId) const
|
||||
{
|
||||
if (tabId < _GetPurchasedTabsSize())
|
||||
if (const RankInfo* rankInfo = GetRankInfo(rankId))
|
||||
if (RankInfo const* rankInfo = GetRankInfo(rankId))
|
||||
return rankInfo->GetBankTabSlotsPerDay(tabId);
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline int8 Guild::_GetRankBankTabRights(uint8 rankId, uint8 tabId) const
|
||||
{
|
||||
if (const RankInfo* rankInfo = GetRankInfo(rankId))
|
||||
if (RankInfo const* rankInfo = GetRankInfo(rankId))
|
||||
return rankInfo->GetBankTabRights(tabId);
|
||||
return 0;
|
||||
}
|
||||
@@ -2620,7 +2620,7 @@ inline void Guild::_UpdateMemberWithdrawSlots(CharacterDatabaseTransaction trans
|
||||
|
||||
inline bool Guild::_MemberHasTabRights(ObjectGuid guid, uint8 tabId, uint32 rights) const
|
||||
{
|
||||
if (const Member* member = GetMember(guid))
|
||||
if (Member const* member = GetMember(guid))
|
||||
{
|
||||
// Leader always has full rights
|
||||
if (member->IsRank(GR_GUILDMASTER) || m_leaderGuid == guid)
|
||||
@@ -2664,7 +2664,7 @@ void Guild::_LogBankEvent(CharacterDatabaseTransaction trans, GuildBankEventLogT
|
||||
|
||||
inline Item* Guild::_GetItem(uint8 tabId, uint8 slotId) const
|
||||
{
|
||||
if (const BankTab* tab = GetBankTab(tabId))
|
||||
if (BankTab const* tab = GetBankTab(tabId))
|
||||
return tab->GetItem(slotId);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@ public: // pussywizard: public class Member
|
||||
};
|
||||
|
||||
// pussywizard: public GetMember
|
||||
inline const Member* GetMember(ObjectGuid guid) const
|
||||
inline Member const* GetMember(ObjectGuid guid) const
|
||||
{
|
||||
auto itr = m_members.find(guid.GetCounter());
|
||||
return (itr != m_members.end()) ? &itr->second : nullptr;
|
||||
@@ -566,7 +566,7 @@ private:
|
||||
|
||||
void SetInfo(std::string_view name, std::string_view icon);
|
||||
void SetText(std::string_view text);
|
||||
void SendText(const Guild* guild, WorldSession* session) const;
|
||||
void SendText(Guild const* guild, WorldSession* session) const;
|
||||
|
||||
std::string const& GetName() const { return m_name; }
|
||||
std::string const& GetIcon() const { return m_icon; }
|
||||
@@ -696,7 +696,7 @@ public:
|
||||
void HandleQuery(WorldSession* session);
|
||||
void HandleSetMOTD(WorldSession* session, std::string_view motd);
|
||||
void HandleSetInfo(WorldSession* session, std::string_view info);
|
||||
void HandleSetEmblem(WorldSession* session, const EmblemInfo& emblemInfo);
|
||||
void HandleSetEmblem(WorldSession* session, EmblemInfo const& emblemInfo);
|
||||
void HandleSetLeader(WorldSession* session, std::string_view name);
|
||||
void HandleSetBankTabInfo(WorldSession* session, uint8 tabId, std::string_view name, std::string_view icon);
|
||||
void HandleSetMemberNote(WorldSession* session, std::string_view name, std::string_view note, bool isPublic);
|
||||
@@ -776,7 +776,7 @@ public:
|
||||
|
||||
void ResetTimes();
|
||||
|
||||
[[nodiscard]] bool ModifyBankMoney(CharacterDatabaseTransaction trans, const uint64& amount, bool add) { return _ModifyBankMoney(trans, amount, add); }
|
||||
[[nodiscard]] bool ModifyBankMoney(CharacterDatabaseTransaction trans, uint64 const& amount, bool add) { return _ModifyBankMoney(trans, amount, add); }
|
||||
[[nodiscard]] uint32 GetMemberSize() const { return m_members.size(); }
|
||||
|
||||
protected:
|
||||
@@ -801,7 +801,7 @@ protected:
|
||||
|
||||
private:
|
||||
inline uint8 _GetRanksSize() const { return uint8(m_ranks.size()); }
|
||||
inline const RankInfo* GetRankInfo(uint8 rankId) const { return rankId < _GetRanksSize() ? &m_ranks[rankId] : nullptr; }
|
||||
inline RankInfo const* GetRankInfo(uint8 rankId) const { return rankId < _GetRanksSize() ? &m_ranks[rankId] : nullptr; }
|
||||
inline RankInfo* GetRankInfo(uint8 rankId) { return rankId < _GetRanksSize() ? &m_ranks[rankId] : nullptr; }
|
||||
inline bool _HasRankRight(Player* player, uint32 right) const
|
||||
{
|
||||
|
||||
@@ -403,7 +403,7 @@ void WorldSession::HandleArenaTeamLeaderOpcode(WorldPacket& recvData)
|
||||
arenaTeam->BroadcastEvent(ERR_ARENA_TEAM_LEADER_CHANGED_SSS, ObjectGuid::Empty, 3, _player->GetName().c_str(), name, arenaTeam->GetName());
|
||||
}
|
||||
|
||||
void WorldSession::SendArenaTeamCommandResult(uint32 teamAction, const std::string& team, const std::string& player, uint32 errorId)
|
||||
void WorldSession::SendArenaTeamCommandResult(uint32 teamAction, std::string const& team, std::string const& player, uint32 errorId)
|
||||
{
|
||||
WorldPacket data(SMSG_ARENA_TEAM_COMMAND_RESULT, 4 + team.length() + 1 + player.length() + 1 + 4);
|
||||
data << uint32(teamAction);
|
||||
|
||||
@@ -294,7 +294,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
|
||||
return;
|
||||
}
|
||||
|
||||
const AuctionHouseEntry* AHEntry = sAuctionMgr->GetAuctionHouseEntryFromFactionTemplate(auctioneerInfo->faction);
|
||||
AuctionHouseEntry const* AHEntry = sAuctionMgr->GetAuctionHouseEntryFromFactionTemplate(auctioneerInfo->faction);
|
||||
AH->houseId = AuctionHouseId(AHEntry->houseId);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class Aura;
|
||||
-FIX sending PartyMemberStats
|
||||
*/
|
||||
|
||||
void WorldSession::SendPartyResult(PartyOperation operation, const std::string& member, PartyResult res, uint32 val /* = 0 */)
|
||||
void WorldSession::SendPartyResult(PartyOperation operation, std::string const& member, PartyResult res, uint32 val /* = 0 */)
|
||||
{
|
||||
WorldPacket data(SMSG_PARTY_COMMAND_RESULT, 4 + member.size() + 1 + 4 + 4);
|
||||
data << uint32(operation);
|
||||
|
||||
@@ -37,7 +37,7 @@ void BuildPlayerLockDungeonBlock(WorldPacket& data, lfg::LfgLockMap const& lock)
|
||||
}
|
||||
}
|
||||
|
||||
void BuildPartyLockDungeonBlock(WorldPacket& data, const lfg::LfgLockPartyMap& lockMap)
|
||||
void BuildPartyLockDungeonBlock(WorldPacket& data, lfg::LfgLockPartyMap const& lockMap)
|
||||
{
|
||||
data << uint8(lockMap.size());
|
||||
for (lfg::LfgLockPartyMap::const_iterator it = lockMap.begin(); it != lockMap.end(); ++it)
|
||||
|
||||
@@ -1088,7 +1088,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket)
|
||||
caster->AddUnitState(UNIT_STATE_FOLLOW);
|
||||
}
|
||||
|
||||
void WorldSession::SendPetNameInvalid(uint32 error, const std::string& name, DeclinedName* declinedName)
|
||||
void WorldSession::SendPetNameInvalid(uint32 error, std::string const& name, DeclinedName* declinedName)
|
||||
{
|
||||
WorldPacket data(SMSG_PET_NAME_INVALID, 4 + name.size() + 1 + 1);
|
||||
data << uint32(error);
|
||||
|
||||
@@ -170,7 +170,7 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket& recvData)
|
||||
ObjectGuid guid;
|
||||
recvData >> guid;
|
||||
|
||||
const GameObjectTemplate* info = sObjectMgr->GetGameObjectTemplate(entry);
|
||||
GameObjectTemplate const* info = sObjectMgr->GetGameObjectTemplate(entry);
|
||||
if (info)
|
||||
{
|
||||
std::string Name;
|
||||
|
||||
@@ -629,7 +629,7 @@ void WorldSession::HandleQueryQuestsCompleted(WorldPacket& /*recvData*/)
|
||||
WorldPacket data(SMSG_QUERY_QUESTS_COMPLETED_RESPONSE, 4 + 4 * rew_count);
|
||||
data << uint32(rew_count);
|
||||
|
||||
const RewardedQuestSet& rewQuests = _player->getRewardedQuests();
|
||||
RewardedQuestSet const& rewQuests = _player->getRewardedQuests();
|
||||
for (RewardedQuestSet::const_iterator itr = rewQuests.begin(); itr != rewQuests.end(); ++itr)
|
||||
data << uint32(*itr);
|
||||
|
||||
|
||||
@@ -477,7 +477,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
|
||||
// pussywizard: casting player's spells from vehicle when seat allows it
|
||||
// if ANYTHING CHANGES in this function, INFORM ME BEFORE applying!!!
|
||||
if (Vehicle* veh = mover->GetVehicleKit())
|
||||
if (const VehicleSeatEntry* seat = veh->GetSeatForPassenger(_player))
|
||||
if (VehicleSeatEntry const* seat = veh->GetSeatForPassenger(_player))
|
||||
if (seat->m_flags & VEHICLE_SEAT_FLAG_CAN_ATTACK || spellInfo->Effects[EFFECT_0].Effect == SPELL_EFFECT_OPEN_LOCK /*allow looting from vehicle, but only if player has required spell (all necessary opening spells are in playercreateinfo_spell)*/)
|
||||
if ((mover->IsCreature() && !mover->ToCreature()->HasSpell(spellId)) || spellInfo->IsPassive()) // the creature can't cast that spell, check player instead
|
||||
{
|
||||
|
||||
@@ -149,7 +149,7 @@ bool InstanceScript::IsEncounterInProgress() const
|
||||
return false;
|
||||
}
|
||||
|
||||
void InstanceScript::LoadBossBoundaries(const BossBoundaryData& data)
|
||||
void InstanceScript::LoadBossBoundaries(BossBoundaryData const& data)
|
||||
{
|
||||
for (BossBoundaryEntry const& entry : data)
|
||||
if (entry.bossId < bosses.size())
|
||||
@@ -167,7 +167,7 @@ void InstanceScript::SetHeaders(std::string const& dataHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
void InstanceScript::LoadMinionData(const MinionData* data)
|
||||
void InstanceScript::LoadMinionData(MinionData const* data)
|
||||
{
|
||||
while (data->entry)
|
||||
{
|
||||
@@ -179,7 +179,7 @@ void InstanceScript::LoadMinionData(const MinionData* data)
|
||||
LOG_DEBUG("scripts.ai", "InstanceScript::LoadMinionData: {} minions loaded.", uint64(minions.size()));
|
||||
}
|
||||
|
||||
void InstanceScript::LoadDoorData(const DoorData* data)
|
||||
void InstanceScript::LoadDoorData(DoorData const* data)
|
||||
{
|
||||
while (data->entry)
|
||||
{
|
||||
@@ -462,7 +462,7 @@ void InstanceScript::DoForAllMinions(uint32 id, std::function<void(Creature*)> e
|
||||
}
|
||||
}
|
||||
|
||||
void InstanceScript::Load(const char* data)
|
||||
void InstanceScript::Load(char const* data)
|
||||
{
|
||||
if (!data)
|
||||
{
|
||||
|
||||
@@ -292,12 +292,12 @@ void LootStore::ReportNonExistingId(uint32 lootId) const
|
||||
LOG_ERROR("sql.sql", "Table '{}' Entry {} does not exist", GetName(), lootId);
|
||||
}
|
||||
|
||||
void LootStore::ReportNonExistingId(uint32 lootId, const char* ownerType, uint32 ownerId) const
|
||||
void LootStore::ReportNonExistingId(uint32 lootId, char const* ownerType, uint32 ownerId) const
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Table '{}' Entry {} does not exist but it is used by {} {}", GetName(), lootId, ownerType, ownerId);
|
||||
}
|
||||
|
||||
void LootStore::ReportInvalidCount(uint32 lootId, const char* ownerType, uint32 ownerId, uint32 itemId, uint8 minCount, uint8 maxCount) const
|
||||
void LootStore::ReportInvalidCount(uint32 lootId, char const* ownerType, uint32 ownerId, uint32 itemId, uint8 minCount, uint8 maxCount) const
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Table '{}' Entry {} used by {} entry {} item {} has minCount ( {} ) != maxCount ( {} ) which is not supported for this loot type.", GetName(), lootId, ownerType, ownerId, itemId, minCount, maxCount);
|
||||
}
|
||||
@@ -913,7 +913,7 @@ bool Loot::hasItemFor(Player* player) const
|
||||
QuestItemList* q_list = q_itr->second;
|
||||
for (QuestItemList::const_iterator qi = q_list->begin(); qi != q_list->end(); ++qi)
|
||||
{
|
||||
const LootItem& item = quest_items[qi->index];
|
||||
LootItem const& item = quest_items[qi->index];
|
||||
if (!qi->is_looted && !item.is_looted)
|
||||
return true;
|
||||
}
|
||||
@@ -926,7 +926,7 @@ bool Loot::hasItemFor(Player* player) const
|
||||
QuestItemList* ffa_list = ffa_itr->second;
|
||||
for (QuestItemList::const_iterator fi = ffa_list->begin(); fi != ffa_list->end(); ++fi)
|
||||
{
|
||||
const LootItem& item = items[fi->index];
|
||||
LootItem const& item = items[fi->index];
|
||||
if (!fi->is_looted && !item.is_looted)
|
||||
return true;
|
||||
}
|
||||
@@ -939,7 +939,7 @@ bool Loot::hasItemFor(Player* player) const
|
||||
QuestItemList* conditional_list = nn_itr->second;
|
||||
for (QuestItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci)
|
||||
{
|
||||
const LootItem& item = items[ci->index];
|
||||
LootItem const& item = items[ci->index];
|
||||
if (!ci->is_looted && !item.is_looted)
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ struct LootItem
|
||||
// Basic checks for player/item compatibility - if false no chance to see the item in the loot
|
||||
bool AllowedForPlayer(Player const* player, ObjectGuid source) const;
|
||||
void AddAllowedLooter(Player const* player);
|
||||
[[nodiscard]] const AllowedLooterSet& GetAllowedLooters() const { return allowedGUIDs; }
|
||||
[[nodiscard]] AllowedLooterSet const& GetAllowedLooters() const { return allowedGUIDs; }
|
||||
};
|
||||
|
||||
struct QuestItem
|
||||
@@ -218,8 +218,8 @@ public:
|
||||
void CheckLootRefs(LootIdSet* ref_set = nullptr) const; // check existence reference and remove it from ref_set
|
||||
void ReportUnusedIds(LootIdSet const& ids_set) const;
|
||||
void ReportNonExistingId(uint32 lootId) const;
|
||||
void ReportNonExistingId(uint32 lootId, const char* ownerType, uint32 ownerId) const;
|
||||
void ReportInvalidCount(uint32 lootId, const char* ownerType, uint32 ownerId, uint32 itemId, uint8 minCount, uint8 maxCount) const;
|
||||
void ReportNonExistingId(uint32 lootId, char const* ownerType, uint32 ownerId) const;
|
||||
void ReportInvalidCount(uint32 lootId, char const* ownerType, uint32 ownerId, uint32 itemId, uint8 minCount, uint8 maxCount) const;
|
||||
|
||||
[[nodiscard]] bool HaveLootFor(uint32 loot_id) const { return m_LootTemplates.find(loot_id) != m_LootTemplates.end(); }
|
||||
[[nodiscard]] bool HaveQuestLootFor(uint32 loot_id) const;
|
||||
|
||||
@@ -2951,7 +2951,7 @@ void Map::LogEncounterFinished(EncounterCreditType type, uint32 creditEntry)
|
||||
if (Player* p = itr->GetSource())
|
||||
{
|
||||
std::string auraStr;
|
||||
const Unit::AuraApplicationMap& a = p->GetAppliedAuras();
|
||||
Unit::AuraApplicationMap const& a = p->GetAppliedAuras();
|
||||
for (auto iterator = a.begin(); iterator != a.end(); ++iterator)
|
||||
{
|
||||
snprintf(buffer2, 255, "%u(%u) ", iterator->first, iterator->second->GetEffectMask());
|
||||
|
||||
+14
-14
@@ -206,7 +206,7 @@ public:
|
||||
void GameObjectRelocation(GameObject* go, float x, float y, float z, float o);
|
||||
void DynamicObjectRelocation(DynamicObject* go, float x, float y, float z, float o);
|
||||
|
||||
template<class T, class CONTAINER> void Visit(const Cell& cell, TypeContainerVisitor<T, CONTAINER>& visitor);
|
||||
template<class T, class CONTAINER> void Visit(Cell const& cell, TypeContainerVisitor<T, CONTAINER>& visitor);
|
||||
|
||||
bool IsGridLoaded(GridCoord const& gridCoord) const;
|
||||
bool IsGridLoaded(float x, float y) const
|
||||
@@ -286,7 +286,7 @@ public:
|
||||
|
||||
virtual EnterState CannotEnter(Player* /*player*/, bool /*loginCheck = false*/) { return CAN_ENTER; }
|
||||
|
||||
[[nodiscard]] const char* GetMapName() const;
|
||||
[[nodiscard]] char const* GetMapName() const;
|
||||
|
||||
// have meaning only for instanced map (that have set real difficulty)
|
||||
[[nodiscard]] Difficulty GetDifficulty() const { return Difficulty(GetSpawnMode()); }
|
||||
@@ -376,10 +376,10 @@ public:
|
||||
}
|
||||
|
||||
MapInstanced* ToMapInstanced() { if (Instanceable()) return reinterpret_cast<MapInstanced*>(this); else return nullptr; }
|
||||
[[nodiscard]] MapInstanced const* ToMapInstanced() const { if (Instanceable()) return (const MapInstanced*)((MapInstanced*)this); else return nullptr; }
|
||||
[[nodiscard]] MapInstanced const* ToMapInstanced() const { if (Instanceable()) return (MapInstanced const*)((MapInstanced*)this); else return nullptr; }
|
||||
|
||||
InstanceMap* ToInstanceMap() { if (IsDungeon()) return reinterpret_cast<InstanceMap*>(this); else return nullptr; }
|
||||
[[nodiscard]] InstanceMap const* ToInstanceMap() const { if (IsDungeon()) return (const InstanceMap*)((InstanceMap*)this); else return nullptr; }
|
||||
[[nodiscard]] InstanceMap const* ToInstanceMap() const { if (IsDungeon()) return (InstanceMap const*)((InstanceMap*)this); else return nullptr; }
|
||||
|
||||
BattlegroundMap* ToBattlegroundMap() { if (IsBattlegroundOrArena()) return reinterpret_cast<BattlegroundMap*>(this); else return nullptr; }
|
||||
[[nodiscard]] BattlegroundMap const* ToBattlegroundMap() const { if (IsBattlegroundOrArena()) return reinterpret_cast<BattlegroundMap const*>(this); return nullptr; }
|
||||
@@ -392,9 +392,9 @@ public:
|
||||
bool CanReachPositionAndGetValidCoords(WorldObject const* source, float startX, float startY, float startZ, float &destX, float &destY, float &destZ, bool failOnCollision = true, bool failOnSlopes = true) const;
|
||||
bool CheckCollisionAndGetValidCoords(WorldObject const* source, float startX, float startY, float startZ, float &destX, float &destY, float &destZ, bool failOnCollision = true) const;
|
||||
void Balance() { _mapCollisionData.GetDynamicTree().balance(); }
|
||||
void RemoveGameObjectModel(const GameObjectModel& model) { _mapCollisionData.GetDynamicTree().remove(model); }
|
||||
void InsertGameObjectModel(const GameObjectModel& model) { _mapCollisionData.GetDynamicTree().insert(model); }
|
||||
[[nodiscard]] bool ContainsGameObjectModel(const GameObjectModel& model) const { return _mapCollisionData.GetDynamicTree().contains(model);}
|
||||
void RemoveGameObjectModel(GameObjectModel const& model) { _mapCollisionData.GetDynamicTree().remove(model); }
|
||||
void InsertGameObjectModel(GameObjectModel const& model) { _mapCollisionData.GetDynamicTree().insert(model); }
|
||||
[[nodiscard]] bool ContainsGameObjectModel(GameObjectModel const& model) const { return _mapCollisionData.GetDynamicTree().contains(model);}
|
||||
[[nodiscard]] DynamicMapTree const& GetDynamicMapTree() const { return _mapCollisionData.GetDynamicTree(); }
|
||||
[[nodiscard]] float GetGameObjectFloor(uint32 phasemask, float x, float y, float z, float maxSearchDist = DEFAULT_HEIGHT_SEARCH) const
|
||||
{
|
||||
@@ -608,13 +608,13 @@ protected:
|
||||
TransportsContainer::iterator _transportsUpdateIter;
|
||||
|
||||
private:
|
||||
Player* _GetScriptPlayerSourceOrTarget(Object* source, Object* target, const ScriptInfo* scriptInfo) const;
|
||||
Creature* _GetScriptCreatureSourceOrTarget(Object* source, Object* target, const ScriptInfo* scriptInfo, bool bReverse = false) const;
|
||||
Unit* _GetScriptUnit(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const;
|
||||
Player* _GetScriptPlayer(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const;
|
||||
Creature* _GetScriptCreature(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const;
|
||||
WorldObject* _GetScriptWorldObject(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const;
|
||||
void _ScriptProcessDoor(Object* source, Object* target, const ScriptInfo* scriptInfo) const;
|
||||
Player* _GetScriptPlayerSourceOrTarget(Object* source, Object* target, ScriptInfo const* scriptInfo) const;
|
||||
Creature* _GetScriptCreatureSourceOrTarget(Object* source, Object* target, ScriptInfo const* scriptInfo, bool bReverse = false) const;
|
||||
Unit* _GetScriptUnit(Object* obj, bool isSource, ScriptInfo const* scriptInfo) const;
|
||||
Player* _GetScriptPlayer(Object* obj, bool isSource, ScriptInfo const* scriptInfo) const;
|
||||
Creature* _GetScriptCreature(Object* obj, bool isSource, ScriptInfo const* scriptInfo) const;
|
||||
WorldObject* _GetScriptWorldObject(Object* obj, bool isSource, ScriptInfo const* scriptInfo) const;
|
||||
void _ScriptProcessDoor(Object* source, Object* target, ScriptInfo const* scriptInfo) const;
|
||||
GameObject* _FindGameObject(WorldObject* pWorldObject, ObjectGuid::LowType guid) const;
|
||||
|
||||
//used for fast base_map (e.g. MapInstanced class object) search for
|
||||
|
||||
@@ -165,8 +165,8 @@ private:
|
||||
MapMgr();
|
||||
~MapMgr();
|
||||
|
||||
MapMgr(const MapMgr&);
|
||||
MapMgr& operator=(const MapMgr&);
|
||||
MapMgr(MapMgr const&);
|
||||
MapMgr& operator=(MapMgr const&);
|
||||
|
||||
std::mutex Lock;
|
||||
MapMapType i_maps;
|
||||
|
||||
@@ -416,7 +416,7 @@ void Graveyard::LoadGraveyardZones()
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
GraveyardStruct const* Graveyard::GetGraveyard(const std::string& name) const
|
||||
GraveyardStruct const* Graveyard::GetGraveyard(std::string const& name) const
|
||||
{
|
||||
// explicit name case
|
||||
std::wstring wname;
|
||||
@@ -427,7 +427,7 @@ GraveyardStruct const* Graveyard::GetGraveyard(const std::string& name) const
|
||||
wstrToLower(wname);
|
||||
|
||||
// Alternative first GameTele what contains wnameLow as substring in case no GameTele location found
|
||||
const GraveyardStruct* alt = nullptr;
|
||||
GraveyardStruct const* alt = nullptr;
|
||||
for (GraveyardContainer::const_iterator itr = _graveyardStore.begin(); itr != _graveyardStore.end(); ++itr)
|
||||
{
|
||||
if (itr->second.wnameLow == wname)
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
typedef std::unordered_map<uint32, GraveyardStruct> GraveyardContainer;
|
||||
|
||||
GraveyardStruct const* GetGraveyard(uint32 ID) const;
|
||||
GraveyardStruct const* GetGraveyard(const std::string& name) const;
|
||||
GraveyardStruct const* GetGraveyard(std::string const& name) const;
|
||||
GraveyardStruct const* GetDefaultGraveyard(TeamId teamId);
|
||||
GraveyardStruct const* GetClosestGraveyard(Player* player, TeamId teamId, bool nearCorpse = false);
|
||||
GraveyardData const* FindGraveyardData(uint32 id, uint32 zone);
|
||||
|
||||
@@ -738,7 +738,7 @@ void MotionMaster::MoveFall(uint32 id /*=0*/, bool addFlagForNPC)
|
||||
/**
|
||||
* @brief The unit will charge the target. Doesn't work with UNIT_FLAG_DISABLE_MOVE
|
||||
*/
|
||||
void MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id, const Movement::PointsArray* path, bool generatePath, float orientation /* = 0.0f*/, ObjectGuid targetGUID /*= ObjectGuid::Empty*/)
|
||||
void MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id, Movement::PointsArray const* path, bool generatePath, float orientation /* = 0.0f*/, ObjectGuid targetGUID /*= ObjectGuid::Empty*/)
|
||||
{
|
||||
if (_owner->HasUnitFlag(UNIT_FLAG_DISABLE_MOVE))
|
||||
return;
|
||||
|
||||
@@ -237,7 +237,7 @@ public:
|
||||
void MoveForwards(Unit* target, float dist);
|
||||
void MoveConfused();
|
||||
void MoveFleeing(Unit* enemy, uint32 time = 0);
|
||||
void MovePoint(uint32 id, const Position& pos, ForcedMovement forcedMovement = FORCED_MOVEMENT_NONE, float speed = 0.f, bool generatePath = true, bool forceDestination = true, std::optional<AnimTier> animTier = std::nullopt)
|
||||
void MovePoint(uint32 id, Position const& pos, ForcedMovement forcedMovement = FORCED_MOVEMENT_NONE, float speed = 0.f, bool generatePath = true, bool forceDestination = true, std::optional<AnimTier> animTier = std::nullopt)
|
||||
{ MovePoint(id, pos.m_positionX, pos.m_positionY, pos.m_positionZ, forcedMovement, speed, pos.GetOrientation(), generatePath, forceDestination, MOTION_SLOT_ACTIVE, animTier); }
|
||||
void MovePoint(uint32 id, float x, float y, float z, ForcedMovement forcedMovement = FORCED_MOVEMENT_NONE, float speed = 0.f, float orientation = 0.0f, bool generatePath = true, bool forceDestination = true, MovementSlot slot = MOTION_SLOT_ACTIVE, std::optional<AnimTier> animTier = std::nullopt);
|
||||
void MoveSplinePath(Movement::PointsArray* path, ForcedMovement forcedMovement = FORCED_MOVEMENT_NONE);
|
||||
@@ -249,7 +249,7 @@ public:
|
||||
void MoveTakeoff(uint32 id, Position const& pos, float speed = 0.0f, bool skipAnimation = false);
|
||||
void MoveTakeoff(uint32 id, float x, float y, float z, float speed = 0.0f, bool skipAnimation = false); // pussywizard: added for easy calling by passing 3 floats x, y, z
|
||||
|
||||
void MoveCharge(float x, float y, float z, float speed = SPEED_CHARGE, uint32 id = EVENT_CHARGE, const Movement::PointsArray* path = nullptr, bool generatePath = false, float orientation = 0.0f, ObjectGuid targetGUID = ObjectGuid::Empty);
|
||||
void MoveCharge(float x, float y, float z, float speed = SPEED_CHARGE, uint32 id = EVENT_CHARGE, Movement::PointsArray const* path = nullptr, bool generatePath = false, float orientation = 0.0f, ObjectGuid targetGUID = ObjectGuid::Empty);
|
||||
void MoveCharge(PathGenerator const& path, float speed = SPEED_CHARGE, ObjectGuid targetGUID = ObjectGuid::Empty);
|
||||
void MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ);
|
||||
void MoveJumpTo(float angle, float speedXY, float speedZ);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user