From dfa10098697132e358eb15f451e441b64c7d61d9 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 18 May 2026 21:37:17 -0300 Subject: [PATCH] fix(Core/Chat): fix crash when using GetModuleString() from console (#25896) Co-authored-by: Claude Sonnet 4.6 --- src/server/game/Chat/Chat.cpp | 5 +++++ src/server/game/Chat/Chat.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 69b969eef..8781540e3 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -895,6 +895,11 @@ std::string CliHandler::GetAcoreString(uint32 entry) const 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*/) { m_print(m_callbackArg, str); diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index 7bc8f0e80..0992c2091 100644 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -156,7 +156,7 @@ public: return Acore::StringFormat(GetAcoreString(entry), std::forward(args)...); } - std::string const* GetModuleString(std::string module, uint32 id) const; + virtual std::string const* GetModuleString(std::string module, uint32 id) const; template void PSendModuleSysMessage(std::string module, uint32 id, Args&&... args) @@ -260,6 +260,7 @@ public: // overwrite functions 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; bool ParseCommands(std::string_view str) override; std::string GetNameLink() const override;