diff options
author | patou01 <2592673+patou01@users.noreply.github.com> | 2021-10-17 16:01:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-17 11:01:58 -0300 |
commit | 74db38ea14be21d27af6cec56f84687d7b9f3aef (patch) | |
tree | f22bdcbcb19894120ccbe1977d0b6e7fc20447bf /src | |
parent | 93703e9083c216221bd3d76b5be39cd920251535 (diff) |
fix(Core/Gossip): Fix gossip menu for locale clients (#8396)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Player/PlayerGossip.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/server/game/Entities/Player/PlayerGossip.cpp b/src/server/game/Entities/Player/PlayerGossip.cpp index d77d676ab6..4db9352211 100644 --- a/src/server/game/Entities/Player/PlayerGossip.cpp +++ b/src/server/game/Entities/Player/PlayerGossip.cpp @@ -161,6 +161,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool if (canTalk) { + // search in broadcast_text and broadcast_text_locale std::string strOptionText, strBoxText; BroadcastText const* optionBroadcastText = sObjectMgr->GetBroadcastText(itr->second.OptionBroadcastTextID); BroadcastText const* boxBroadcastText = sObjectMgr->GetBroadcastText(itr->second.BoxBroadcastTextID); @@ -176,16 +177,17 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool else strBoxText = itr->second.BoxText; + // if the language is not default and the texts weren't found, maybe they're in gossip_menu_option_locale table if (locale != DEFAULT_LOCALE) { - if (!optionBroadcastText) + if (strOptionText.empty()) { /// Find localizations from database. if (GossipMenuItemsLocale const* gossipMenuLocale = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, itr->second.OptionID))) ObjectMgr::GetLocaleString(gossipMenuLocale->OptionText, locale, strOptionText); } - if (!boxBroadcastText) + if (strBoxText.empty()) { /// Find localizations from database. if (GossipMenuItemsLocale const* gossipMenuLocale = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, itr->second.OptionID))) @@ -433,4 +435,4 @@ uint32 Player::GetDefaultGossipMenuForSource(WorldObject* source) void Player::ToggleInstantFlight() { m_isInstantFlightOn = !m_isInstantFlightOn; -}
\ No newline at end of file +} |