[Bug Fix] Fix Silent Saylinks Sending Message to Others. (#2389)

* [Bug Fix] Fix Silent Saylinks Sending Message to Others.
Silent saylinks wouldn't send to sender, but to everyone else, so they could see what your saylinks were.

Added an optional `is_silent` bool to ChannelMessageReceived to account for this where necessary.

* Nullptr fix.
This commit is contained in:
Kinglykrab
2022-08-21 23:26:25 -04:00
committed by GitHub
parent c0d4dd4176
commit b9d8a13c76
4 changed files with 10 additions and 7 deletions
+5 -2
View File
@@ -830,7 +830,7 @@ void Client::FastQueuePacket(EQApplicationPacket** app, bool ack_req, CLIENT_CON
return;
}
void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_skill, const char* orig_message, const char* targetname) {
void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_skill, const char* orig_message, const char* targetname, bool is_silent) {
char message[4096];
strn0cpy(message, orig_message, sizeof(message));
@@ -1168,7 +1168,10 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
if (GetPet() && GetTarget() == GetPet() && GetPet()->FindType(SE_VoiceGraft))
sender = GetPet();
entity_list.ChannelMessage(sender, chan_num, language, lang_skill, message);
if (!is_silent) {
entity_list.ChannelMessage(sender, chan_num, language, lang_skill, message);
}
parse->EventPlayer(EVENT_SAY, this, message, language);
if (sender != this)