FOREACH_CLIENT(!(IS_PLAYER(it) || it.caplayer) && IS_REAL_CLIENT(it) && it != source && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), {
sprint(it, msgstr);
});
- play_chatsound(source, msgin);
- event_log_msg = sprintf(":chat_spec:%d:%s", source.playerid, strreplace("\n", " ", msgin));
+
+ if(play_chatsound(source, msgin))
+ event_log_msg = sprintf(":chat_spec:%d:%s", source.playerid, strreplace("\n", " ", msgin));
}
else
{
FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != source && !MUTATOR_CALLHOOK(ChatMessageTo, it, source), {
sprint(it, msgstr);
});
- play_chatsound(source, msgin);
- event_log_msg = sprintf(":chat:%d:%s", source.playerid, strreplace("\n", " ", msgin));
+
+ if(play_chatsound(source, msgin))
+ event_log_msg = sprintf(":chat:%d:%s", source.playerid, strreplace("\n", " ", msgin));
}
}
GameLogEcho(event_log_msg);
}
-
-
return ret;
}
-void play_chatsound(entity source, string msgin)
+bool play_chatsound(entity source, string msgin)
{
if(autocvar_g_chat_sounds) {
var .float flood_sound = floodcontrol_chatsound;
//bprintf("msg is %s and list is %s\n", rawmsg, autocvar_g_chat_sounds_list);
if (findinlist_abbrev(rawmsg, autocvar_g_chat_sounds_list)) {
play2all(strcat("sound/chat/", rawmsg, ".ogg"));
-
source.(flood_sound) = time;
+
+ return true;
}
}
}
+
+ return false;
}
// hack to copy the button fields from the client entity to the Client State
void PM_UpdateButtons(entity this, entity store)