From 9ab61d4ed4262247e7f64c6a16b52d2091c40588 Mon Sep 17 00:00:00 2001 From: Noudess Date: Tue, 18 Aug 2020 11:15:33 -0400 Subject: [PATCH] Fix so an untargettable mob is not opened for trade when client pressed the 'u' key. Discovered this on untargettable mobs at doors. --- zone/client_packet.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 19773f3a4..47066a5aa 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -14246,12 +14246,19 @@ void Client::Handle_OP_TradeRequest(const EQApplicationPacket *app) // Client requesting a trade session from an npc/client // Trade session not started until OP_TradeRequestAck is sent - CommonBreakInvisible(); - - // Pass trade request on to recipient TradeRequest_Struct* msg = (TradeRequest_Struct*)app->pBuffer; Mob* tradee = entity_list.GetMob(msg->to_mob_id); + // If the tradee is an untargettable mob - ignore + // Helps in cases where servers use invisible_man, body type 11 for quests + // and the client opens a trade by mistake. + if (tradee && (tradee->GetBodyType() == 11)) { + return; + } + + CommonBreakInvisible(); + + // Pass trade request on to recipient if (tradee && tradee->IsClient()) { tradee->CastToClient()->QueuePacket(app); }