From 6ed2b2277df12816c97a7f0a6aaf3b4ce3ec2e68 Mon Sep 17 00:00:00 2001 From: Kyle Bradley Date: Thu, 11 Mar 2021 09:20:26 +0200 Subject: [PATCH] Added break on primary message while still processing subsequent --- src/game/server/player.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/game/server/player.cpp b/src/game/server/player.cpp index 24f2a9855..8ed2992de 100644 --- a/src/game/server/player.cpp +++ b/src/game/server/player.cpp @@ -933,13 +933,21 @@ void CPlayer::ProcessScoreResult(CScorePlayerResult &Result) } break; case CScorePlayerResult::ALL: + { + bool PrimaryMessage = true; for(auto &aMessage : Result.m_Data.m_aaMessages) { if(aMessage[0] == 0) break; - GameServer()->SendChat(-1, CGameContext::CHAT_ALL, aMessage, m_ClientID); + + if(GameServer()->ProcessSpamProtection(m_ClientID) && PrimaryMessage) + break; + + GameServer()->SendChat(-1, CGameContext::CHAT_ALL, aMessage, -1); + PrimaryMessage = false; } break; + } case CScorePlayerResult::BROADCAST: if(Result.m_Data.m_Broadcast[0] != 0) GameServer()->SendBroadcast(Result.m_Data.m_Broadcast, -1);