fix(Core/Player): Sometimes Player whisper is sent as boss whisper (#18128)

* fix(Core/Player): Sometimes Player emot is sent as boss whisper

* actually change it to whisper as it is boss whisper

* Update Player.cpp
This commit is contained in:
Kitzunu
2024-01-07 16:14:20 +01:00
committed by GitHub
parent add61eac20
commit bceb6173c2

View File

@@ -9364,12 +9364,10 @@ void Player::Whisper(std::string_view text, Language language, Player* target, b
}
}
void Player::Whisper(uint32 textId, Player* target, bool /*isBossWhisper = false*/)
void Player::Whisper(uint32 textId, Player* target, bool isBossWhisper)
{
if (!target)
{
return;
}
BroadcastText const* bct = sObjectMgr->GetBroadcastText(textId);
if (!bct)
@@ -9380,7 +9378,10 @@ void Player::Whisper(uint32 textId, Player* target, bool /*isBossWhisper = false
LocaleConstant locale = target->GetSession()->GetSessionDbLocaleIndex();
WorldPacket data;
ChatHandler::BuildChatPacket(data, CHAT_MSG_WHISPER, LANG_UNIVERSAL, this, target, bct->GetText(locale, getGender()), 0, "", locale);
if (isBossWhisper)
ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID_BOSS_WHISPER, LANG_UNIVERSAL, this, target, bct->GetText(locale, getGender()), 0, "", locale);
else
ChatHandler::BuildChatPacket(data, CHAT_MSG_WHISPER, LANG_UNIVERSAL, this, target, bct->GetText(locale, getGender()), 0, "", locale);
target->SendDirectMessage(&data);
}