mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-30 09:03:47 +00:00
Merge branch 'master' into Playerbot
This commit is contained in:
@@ -3167,3 +3167,8 @@ GuidUnorderedSet const& WorldObject::GetAllowedLooters() const
|
||||
{
|
||||
return _allowedLooters;
|
||||
}
|
||||
|
||||
void WorldObject::RemoveAllowedLooter(ObjectGuid guid)
|
||||
{
|
||||
_allowedLooters.erase(guid);
|
||||
}
|
||||
|
||||
@@ -614,6 +614,7 @@ public:
|
||||
void SetAllowedLooters(GuidUnorderedSet const looters);
|
||||
[[nodiscard]] bool HasAllowedLooter(ObjectGuid guid) const;
|
||||
[[nodiscard]] GuidUnorderedSet const& GetAllowedLooters() const;
|
||||
void RemoveAllowedLooter(ObjectGuid guid);
|
||||
|
||||
std::string GetDebugInfo() const override;
|
||||
|
||||
|
||||
@@ -164,33 +164,31 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
|
||||
|
||||
if (canTalk)
|
||||
{
|
||||
// using gossip_menu_option texts by default
|
||||
std::string strOptionText = itr->second.OptionText;
|
||||
std::string strBoxText = itr->second.BoxText;
|
||||
// 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);
|
||||
LocaleConstant locale = GetSession()->GetSessionDbLocaleIndex();
|
||||
|
||||
if (optionBroadcastText)
|
||||
ObjectMgr::GetLocaleString(getGender() == GENDER_MALE ? optionBroadcastText->MaleText : optionBroadcastText->FemaleText, locale, strOptionText);
|
||||
else
|
||||
strOptionText = itr->second.OptionText;
|
||||
|
||||
if (boxBroadcastText)
|
||||
ObjectMgr::GetLocaleString(getGender() == GENDER_MALE ? boxBroadcastText->MaleText : boxBroadcastText->FemaleText, locale, strBoxText);
|
||||
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 (strOptionText.empty())
|
||||
if (!optionBroadcastText)
|
||||
{
|
||||
/// Find localizations from database.
|
||||
if (GossipMenuItemsLocale const* gossipMenuLocale = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, itr->second.OptionID)))
|
||||
ObjectMgr::GetLocaleString(gossipMenuLocale->OptionText, locale, strOptionText);
|
||||
}
|
||||
|
||||
if (strBoxText.empty())
|
||||
if (!boxBroadcastText)
|
||||
{
|
||||
/// Find localizations from database.
|
||||
if (GossipMenuItemsLocale const* gossipMenuLocale = sObjectMgr->GetGossipMenuItemsLocale(MAKE_PAIR32(menuId, itr->second.OptionID)))
|
||||
|
||||
Reference in New Issue
Block a user