Skip to content

Commit dfa1009

Browse files
Nyeriahclaude
andauthored
fix(Core/Chat): fix crash when using GetModuleString() from console (azerothcore#25896)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3474fb9 commit dfa1009

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/server/game/Chat/Chat.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,11 @@ std::string CliHandler::GetAcoreString(uint32 entry) const
895895
return sObjectMgr->GetAcoreStringForDBCLocale(entry);
896896
}
897897

898+
std::string const* CliHandler::GetModuleString(std::string module, uint32 id) const
899+
{
900+
return sObjectMgr->GetModuleString(module, id, LocaleConstant(sObjectMgr->GetDBCLocaleIndex()));
901+
}
902+
898903
void CliHandler::SendSysMessage(std::string_view str, bool /*escapeCharacters*/)
899904
{
900905
m_print(m_callbackArg, str);

src/server/game/Chat/Chat.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class AC_GAME_API ChatHandler
156156
return Acore::StringFormat(GetAcoreString(entry), std::forward<Args>(args)...);
157157
}
158158

159-
std::string const* GetModuleString(std::string module, uint32 id) const;
159+
virtual std::string const* GetModuleString(std::string module, uint32 id) const;
160160

161161
template<typename... Args>
162162
void PSendModuleSysMessage(std::string module, uint32 id, Args&&... args)
@@ -260,6 +260,7 @@ class AC_GAME_API CliHandler : public ChatHandler
260260

261261
// overwrite functions
262262
std::string GetAcoreString(uint32 entry) const override;
263+
std::string const* GetModuleString(std::string module, uint32 id) const override;
263264
void SendSysMessage(std::string_view, bool escapeCharacters) override;
264265
bool ParseCommands(std::string_view str) override;
265266
std::string GetNameLink() const override;

0 commit comments

Comments
 (0)