From 7a841c11c5738fa6bc686072a7b7f3b98d40a406 Mon Sep 17 00:00:00 2001 From: Mitch Freeman <65987027+neckkola@users.noreply.github.com> Date: Sun, 24 Nov 2024 19:17:01 -0400 Subject: [PATCH] [Bug Fix] Players could become flagged as a Trader when they were not trading (#4553) --- common/servertalk.h | 1 + zone/trading.cpp | 9 +++++---- zone/worldserver.cpp | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/common/servertalk.h b/common/servertalk.h index 46a3e08bc..5761c1e79 100644 --- a/common/servertalk.h +++ b/common/servertalk.h @@ -1945,6 +1945,7 @@ struct ServerOP_GuildMessage_Struct { struct TraderMessaging_Struct { uint32 action; uint32 zone_id; + uint32 instance_id; uint32 trader_id; uint32 entity_id; char trader_name[64]; diff --git a/zone/trading.cpp b/zone/trading.cpp index d3896fb09..faa113066 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -2913,10 +2913,11 @@ void Client::SendBecomeTraderToWorld(Client *trader, BazaarTraderBarterActions a auto outapp = new ServerPacket(ServerOP_TraderMessaging, sizeof(TraderMessaging_Struct)); auto data = (TraderMessaging_Struct *) outapp->pBuffer; - data->action = action; - data->entity_id = trader->GetID(); - data->trader_id = trader->CharacterID(); - data->zone_id = trader->GetZoneID(); + data->action = action; + data->entity_id = trader->GetID(); + data->trader_id = trader->CharacterID(); + data->zone_id = trader->GetZoneID(); + data->instance_id = trader->GetInstanceID(); strn0cpy(data->trader_name, trader->GetName(), sizeof(data->trader_name)); worldserver.SendPacket(outapp); diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index acfb686df..afff2a534 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -3942,7 +3942,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) c.second->QueuePacket(outapp); safe_delete(outapp); } - if (zone && zone->GetZoneID() == Zones::BAZAAR) { + if (zone && zone->GetZoneID() == Zones::BAZAAR && in->instance_id == zone->GetInstanceID()) { if (in->action == TraderOn) { c.second->SendBecomeTrader(TraderOn, in->entity_id); }