From 8fced9f7f3453efa0f26e16da200d178e7a4aae9 Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 2 Jun 2020 17:09:36 +0200 Subject: [PATCH] Part 2 of "Check joinAllowed again before actually joining, fixes race conditions where players can bypass the player limit" (perform the same check when spectating another player) --- qcsrc/server/client.qc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index af2846c8c..ce495c347 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -2363,7 +2363,8 @@ void SpectatorThink(entity this) if(this.flags & FL_SPAWNING) { this.flags &= ~FL_SPAWNING; - Join(this); + if(joinAllowed(this)) + Join(this); return; } } -- 2.39.2