mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 18:38:26 +00:00
Fix potential issue with team chat. (#524)
This commit is contained in:
parent
db441dd28c
commit
ef539c1ac5
@ -369,15 +369,18 @@ public Action CP_OnChatMessage(int &author, ArrayList recipients, char[] flagstr
|
||||
FormatRandom(message, MAXLENGTH_MESSAGE);
|
||||
}
|
||||
|
||||
#if defined DEBUG
|
||||
PrintToServer("%N %s", author, flagstring);
|
||||
#endif
|
||||
|
||||
bool allchat = (StrContains(flagstring, "_All") != -1);
|
||||
int team = GetClientTeam(author);
|
||||
|
||||
recipients.Clear();
|
||||
recipients.Push(author);
|
||||
|
||||
for(int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
if(i != author && IsClientInGame(i) && (allchat || GetClientTeam(i) == team))
|
||||
if(i == author || (IsClientInGame(i) && (allchat || GetClientTeam(i) == team)))
|
||||
{
|
||||
recipients.Push(i);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user