mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(Core/Chat): fix crash when using GetModuleString() from console (#25896)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -895,6 +895,11 @@ std::string CliHandler::GetAcoreString(uint32 entry) const
|
|||||||
return sObjectMgr->GetAcoreStringForDBCLocale(entry);
|
return sObjectMgr->GetAcoreStringForDBCLocale(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string const* CliHandler::GetModuleString(std::string module, uint32 id) const
|
||||||
|
{
|
||||||
|
return sObjectMgr->GetModuleString(module, id, LocaleConstant(sObjectMgr->GetDBCLocaleIndex()));
|
||||||
|
}
|
||||||
|
|
||||||
void CliHandler::SendSysMessage(std::string_view str, bool /*escapeCharacters*/)
|
void CliHandler::SendSysMessage(std::string_view str, bool /*escapeCharacters*/)
|
||||||
{
|
{
|
||||||
m_print(m_callbackArg, str);
|
m_print(m_callbackArg, str);
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ public:
|
|||||||
return Acore::StringFormat(GetAcoreString(entry), std::forward<Args>(args)...);
|
return Acore::StringFormat(GetAcoreString(entry), std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string const* GetModuleString(std::string module, uint32 id) const;
|
virtual std::string const* GetModuleString(std::string module, uint32 id) const;
|
||||||
|
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
void PSendModuleSysMessage(std::string module, uint32 id, Args&&... args)
|
void PSendModuleSysMessage(std::string module, uint32 id, Args&&... args)
|
||||||
@@ -260,6 +260,7 @@ public:
|
|||||||
|
|
||||||
// overwrite functions
|
// overwrite functions
|
||||||
std::string GetAcoreString(uint32 entry) const override;
|
std::string GetAcoreString(uint32 entry) const override;
|
||||||
|
std::string const* GetModuleString(std::string module, uint32 id) const override;
|
||||||
void SendSysMessage(std::string_view, bool escapeCharacters) override;
|
void SendSysMessage(std::string_view, bool escapeCharacters) override;
|
||||||
bool ParseCommands(std::string_view str) override;
|
bool ParseCommands(std::string_view str) override;
|
||||||
std::string GetNameLink() const override;
|
std::string GetNameLink() const override;
|
||||||
|
|||||||
Reference in New Issue
Block a user