]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add safety checks
authorterencehill <piuntn@gmail.com>
Thu, 25 Aug 2016 09:25:19 +0000 (11:25 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 25 Aug 2016 09:25:19 +0000 (11:25 +0200)
qcsrc/server/client.qc

index b2fee6690928925ca3f173494a012c3161d3ee68..d0449418383128bfc92d1a639abda7d01d449ba4 100644 (file)
@@ -1906,7 +1906,7 @@ int nJoinAllowed(entity this, entity ignore)
                        return 0;
        }
 
-       if(this.team_forced < 0)
+       if(this && this.team_forced < 0)
                return 0; // forced spectators can never join
 
        // TODO simplify this
@@ -1927,7 +1927,7 @@ int nJoinAllowed(entity this, entity ignore)
                free_slots = min(maxclients - totalClients, autocvar_g_maxplayers - currentlyPlaying);
 
        static float join_prevent_msg_time = 0;
-       if(ignore && !free_slots && time > join_prevent_msg_time)
+       if(this && ignore && !free_slots && time > join_prevent_msg_time)
        {
                Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_JOIN_PREVENT);
                join_prevent_msg_time = time + 3;