mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-28 14:35:57 +00:00
refactor(Core/ObjectMgr): Change GetAcoreString from char const* to s… (#21213)
...ring
This commit is contained in:
@@ -8770,19 +8770,20 @@ bool ObjectMgr::LoadAcoreStrings()
|
||||
return true;
|
||||
}
|
||||
|
||||
char const* ObjectMgr::GetAcoreString(uint32 entry, LocaleConstant locale) const
|
||||
std::string ObjectMgr::GetAcoreString(uint32 entry, LocaleConstant locale) const
|
||||
{
|
||||
if (AcoreString const* ts = GetAcoreString(entry))
|
||||
AcoreString const* as = GetAcoreString(entry);
|
||||
if (as && !as->Content.empty())
|
||||
{
|
||||
if (ts->Content.size() > std::size_t(locale) && !ts->Content[locale].empty())
|
||||
return ts->Content[locale].c_str();
|
||||
if (as->Content.size() > std::size_t(locale) && !as->Content[locale].empty())
|
||||
return as->Content[locale];
|
||||
|
||||
return ts->Content[DEFAULT_LOCALE].c_str();
|
||||
return as->Content[DEFAULT_LOCALE];
|
||||
}
|
||||
|
||||
LOG_ERROR("sql.sql", "Acore string entry {} not found in DB.", entry);
|
||||
|
||||
return "<error>";
|
||||
std::string msg = Acore::StringFormat("No entry for acore_string ({}) in DB.", entry);
|
||||
LOG_ERROR("sql.sql", msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadFishingBaseSkillLevel()
|
||||
|
||||
Reference in New Issue
Block a user