mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 18:40:28 +00:00
fix(Core/Gossips): Properly send packet with questgiver query handler. (#12290)
Fixes #12215
This commit is contained in:
@@ -98,6 +98,12 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket& recv_data)
|
||||
if (_player->PlayerTalkClass->IsGossipOptionCoded(gossipListId))
|
||||
recv_data >> code;
|
||||
|
||||
// Prevent cheating on C++ scripted menus
|
||||
if (_player->PlayerTalkClass->GetGossipMenu().GetSenderGUID() != guid)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Creature* unit = nullptr;
|
||||
GameObject* go = nullptr;
|
||||
Item* item = nullptr;
|
||||
@@ -528,6 +534,16 @@ void WorldSession::HandleSetSelectionOpcode(WorldPacket& recv_data)
|
||||
ObjectGuid guid;
|
||||
recv_data >> guid;
|
||||
|
||||
if (!guid)
|
||||
{
|
||||
// Clear any active gossip related to current selection if not present at player's client
|
||||
GossipMenu& gossipMenu = _player->PlayerTalkClass->GetGossipMenu();
|
||||
if (gossipMenu.GetSenderGUID() == _player->GetTarget())
|
||||
{
|
||||
_player->PlayerTalkClass->SendCloseGossip();
|
||||
}
|
||||
}
|
||||
|
||||
_player->SetSelection(guid);
|
||||
|
||||
// Change target of current autoshoot spell
|
||||
|
||||
Reference in New Issue
Block a user