refactor(Core/ObjectMgr): Change GetAcoreString from char const* to s… (#21213)

...ring
This commit is contained in:
Kitzunu
2025-02-01 22:46:42 +01:00
committed by GitHub
parent 137337601d
commit 9e9a2fe5e3
25 changed files with 71 additions and 95 deletions

View File

@@ -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()