mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-06 12:27:48 +00:00
fix(Core/Gossip): Fix gossip menu for locale clients (#8396)
This commit is contained in:
@@ -161,6 +161,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
|
|||||||
|
|
||||||
if (canTalk)
|
if (canTalk)
|
||||||
{
|
{
|
||||||
|
// search in broadcast_text and broadcast_text_locale
|
||||||
std::string strOptionText, strBoxText;
|
std::string strOptionText, strBoxText;
|
||||||
BroadcastText const* optionBroadcastText = sObjectMgr->GetBroadcastText(itr->second.OptionBroadcastTextID);
|
BroadcastText const* optionBroadcastText = sObjectMgr->GetBroadcastText(itr->second.OptionBroadcastTextID);
|
||||||
BroadcastText const* boxBroadcastText = sObjectMgr->GetBroadcastText(itr->second.BoxBroadcastTextID);
|
BroadcastText const* boxBroadcastText = sObjectMgr->GetBroadcastText(itr->second.BoxBroadcastTextID);
|
||||||
@@ -176,16 +177,17 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
|
|||||||
else
|
else
|
||||||
strBoxText = itr->second.BoxText;
|
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 (locale != DEFAULT_LOCALE)
|
||||||
{
|
{
|
||||||
if (!optionBroadcastText)
|
if (strOptionText.empty())
|
||||||
{
|
{
|
||||||
/// Find localizations from database.
|
/// Find localizations from database.
|
||||||
if (GossipMenuItemsLocale const* gossipMenuLocale = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, itr->second.OptionID)))
|
if (GossipMenuItemsLocale const* gossipMenuLocale = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, itr->second.OptionID)))
|
||||||
ObjectMgr::GetLocaleString(gossipMenuLocale->OptionText, locale, strOptionText);
|
ObjectMgr::GetLocaleString(gossipMenuLocale->OptionText, locale, strOptionText);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!boxBroadcastText)
|
if (strBoxText.empty())
|
||||||
{
|
{
|
||||||
/// Find localizations from database.
|
/// Find localizations from database.
|
||||||
if (GossipMenuItemsLocale const* gossipMenuLocale = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, itr->second.OptionID)))
|
if (GossipMenuItemsLocale const* gossipMenuLocale = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, itr->second.OptionID)))
|
||||||
@@ -433,4 +435,4 @@ uint32 Player::GetDefaultGossipMenuForSource(WorldObject* source)
|
|||||||
void Player::ToggleInstantFlight()
|
void Player::ToggleInstantFlight()
|
||||||
{
|
{
|
||||||
m_isInstantFlightOn = !m_isInstantFlightOn;
|
m_isInstantFlightOn = !m_isInstantFlightOn;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user