[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.
This commit is contained in:
Kinglykrab 2022-08-21 20:54:40 -04:00 committed by GitHub
parent 893d53425a
commit c954685239
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.");