Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2025-02-04 23:40:06 +08:00
81 changed files with 3144 additions and 611 deletions
+12 -11
View File
@@ -3072,7 +3072,7 @@ void ObjectMgr::LoadItemTemplates()
else if (itemTemplate.Spells[1].SpellId != -1)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itemTemplate.Spells[1].SpellId);
if (!spellInfo && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, itemTemplate.Spells[1].SpellId, nullptr))
if (!spellInfo && !sDisableMgr->IsDisabledFor(DISABLE_TYPE_SPELL, itemTemplate.Spells[1].SpellId, nullptr))
{
LOG_ERROR("sql.sql", "Item (Entry: {}) has wrong (not existing) spell in spellid_{} ({})", entry, 1 + 1, itemTemplate.Spells[1].SpellId);
itemTemplate.Spells[0].SpellId = 0;
@@ -3120,7 +3120,7 @@ void ObjectMgr::LoadItemTemplates()
if (itemTemplate.Spells[j].SpellId && itemTemplate.Spells[j].SpellId != -1)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itemTemplate.Spells[j].SpellId);
if (!spellInfo && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, itemTemplate.Spells[j].SpellId, nullptr))
if (!spellInfo && !sDisableMgr->IsDisabledFor(DISABLE_TYPE_SPELL, itemTemplate.Spells[j].SpellId, nullptr))
{
LOG_ERROR("sql.sql", "Item (Entry: {}) has wrong (not existing) spell in spellid_{} ({})", entry, j + 1, itemTemplate.Spells[j].SpellId);
itemTemplate.Spells[j].SpellId = 0;
@@ -4616,7 +4616,7 @@ void ObjectMgr::LoadQuests()
for (QuestMap::iterator iter = _questTemplates.begin(); iter != _questTemplates.end(); ++iter)
{
// skip post-loading checks for disabled quests
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, iter->first, nullptr))
if (sDisableMgr->IsDisabledFor(DISABLE_TYPE_QUEST, iter->first, nullptr))
continue;
Quest* qinfo = iter->second;
@@ -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()
+2 -2
View File
@@ -1315,8 +1315,8 @@ public:
return &itr->second;
}
[[nodiscard]] char const* GetAcoreString(uint32 entry, LocaleConstant locale) const;
[[nodiscard]] char const* GetAcoreStringForDBCLocale(uint32 entry) const { return GetAcoreString(entry, DBCLocaleIndex); }
[[nodiscard]] std::string GetAcoreString(uint32 entry, LocaleConstant locale) const;
[[nodiscard]] std::string GetAcoreStringForDBCLocale(uint32 entry) const { return GetAcoreString(entry, DBCLocaleIndex); }
[[nodiscard]] LocaleConstant GetDBCLocaleIndex() const { return DBCLocaleIndex; }
void SetDBCLocaleIndex(LocaleConstant locale) { DBCLocaleIndex = locale; }