From 21636912c035cb6b25ea587edf57c748e0a5745b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Tue, 3 Jan 2023 23:27:00 +0100 Subject: [PATCH] Refactor team state unpacking --- src/game/client/gameclient.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index cbbdba2b8..0a33445b9 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -810,18 +810,10 @@ void CGameClient::OnMessage(int MsgId, CUnpacker *pUnpacker, int Conn, bool Dumm for(i = 0; i < MAX_CLIENTS; i++) { - int Team = pUnpacker->GetInt(); - bool WentWrong = false; - - if(pUnpacker->Error()) - WentWrong = true; - - if(!WentWrong && Team >= TEAM_FLOCK && Team <= TEAM_SUPER) + const int Team = pUnpacker->GetInt(); + if(!pUnpacker->Error() && Team >= TEAM_FLOCK && Team <= TEAM_SUPER) m_Teams.Team(i, Team); else - WentWrong = true; - - if(WentWrong) { m_Teams.Team(i, 0); break;