From c954685239e6dfd488f4fa5582380e3b7d6c5bdf Mon Sep 17 00:00:00 2001 From: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com> Date: Sun, 21 Aug 2022 20:54:40 -0400 Subject: [PATCH] [Bug Fix] Fix Duplicate Silent Saylink Messages (#2386) Clicking silent saylinks was sending the message twice if you had an NPC targeted due to duplicate code within ChannelMessageReceived. --- zone/client_packet.cpp | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 69399ec4c..5cc62d812 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -8528,26 +8528,13 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app) return; } - if (GetTarget() && GetTarget()->IsNPC()) { - if (silentsaylink) { - parse->EventNPC(EVENT_SAY, GetTarget()->CastToNPC(), this, response, 0); - } - else { - Message(Chat::LightGray, "You say, '%s'", response.c_str()); - } + ChannelMessageReceived(ChatChannel_Say, 0, 100, response.c_str()); - ChannelMessageReceived(ChatChannel_Say, 0, 100, response.c_str()); - - return; + if (!silentsaylink) { + Message(Chat::LightGray, "You say, '%s'", response.c_str()); } - else { - ChannelMessageReceived(ChatChannel_Say, 0, 100, response.c_str()); - if (!silentsaylink) { - Message(Chat::LightGray, "You say, '%s'", response.c_str()); - } - return; - } + return; } else { Message(Chat::Red, "Error: Say Link not found or is too long.");