mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-06 12:27:48 +00:00
feat(Core/Chat): new argument parsing and unify chat hyperlink parsing (#6243)
This commit is contained in:
@@ -6981,7 +6981,7 @@ std::string ObjectMgr::GeneratePetName(uint32 entry)
|
||||
if (list0.empty() || list1.empty())
|
||||
{
|
||||
CreatureTemplate const* cinfo = GetCreatureTemplate(entry);
|
||||
char* petname = GetPetName(cinfo->family, sWorld->GetDefaultDbcLocale());
|
||||
char const* petname = GetPetName(cinfo->family, sWorld->GetDefaultDbcLocale());
|
||||
if (!petname)
|
||||
return cinfo->Name;
|
||||
|
||||
@@ -8124,7 +8124,7 @@ void ObjectMgr::LoadGameTele()
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
GameTele const* ObjectMgr::GetGameTele(const std::string& name) const
|
||||
GameTele const* ObjectMgr::GetGameTele(std::string_view name) const
|
||||
{
|
||||
// explicit name case
|
||||
std::wstring wname;
|
||||
@@ -8180,7 +8180,7 @@ bool ObjectMgr::AddGameTele(GameTele& tele)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ObjectMgr::DeleteGameTele(const std::string& name)
|
||||
bool ObjectMgr::DeleteGameTele(std::string_view name)
|
||||
{
|
||||
// explicit name case
|
||||
std::wstring wname;
|
||||
|
||||
@@ -1287,10 +1287,10 @@ public:
|
||||
if (itr == _gameTeleStore.end()) return nullptr;
|
||||
return &itr->second;
|
||||
}
|
||||
[[nodiscard]] GameTele const* GetGameTele(std::string const& name) const;
|
||||
[[nodiscard]] GameTele const* GetGameTele(std::string_view name) const;
|
||||
[[nodiscard]] GameTeleContainer const& GetGameTeleMap() const { return _gameTeleStore; }
|
||||
bool AddGameTele(GameTele& data);
|
||||
bool DeleteGameTele(std::string const& name);
|
||||
bool DeleteGameTele(std::string_view name);
|
||||
|
||||
[[nodiscard]] TrainerSpellData const* GetNpcTrainerSpells(uint32 entry) const
|
||||
{
|
||||
@@ -1344,6 +1344,13 @@ public:
|
||||
}
|
||||
|
||||
static void AddLocaleString(std::string&& s, LocaleConstant locale, std::vector<std::string>& data);
|
||||
static std::string_view GetLocaleString(std::vector<std::string> const& data, size_t locale)
|
||||
{
|
||||
if (locale < data.size())
|
||||
return data[locale];
|
||||
else
|
||||
return {};
|
||||
}
|
||||
static inline void GetLocaleString(const std::vector<std::string>& data, int loc_idx, std::string& value)
|
||||
{
|
||||
if (data.size() > size_t(loc_idx) && !data[loc_idx].empty())
|
||||
|
||||
Reference in New Issue
Block a user