From: terencehill Date: Thu, 25 Aug 2016 09:25:19 +0000 (+0200) Subject: Add safety checks X-Git-Tag: xonotic-v0.8.2~620^2~10 X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;h=74a3a7c6b47ed4faf93c67718caeffa0eda8025e;p=xonotic%2Fxonotic-data.pk3dir.git Add safety checks --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index b2fee6690..d04494183 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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;