]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/client.qc
Fix kicked player not receiving the kick message (if sent with Send_Notification)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / client.qc
index e988d4bdc9f9b88883bd182fb65c77a452398a78..7d3c1faca69520d5faa995bcfa443259d4ba668a 100644 (file)
@@ -2458,9 +2458,8 @@ void PlayerPreThink (entity this)
                        && (IS_SPEC(this) || IS_OBSERVER(this)) && !this.caplayer
                        && time > (CS(this).spectatortime + autocvar_g_maxplayers_spectator_blocktime))
                {
-                       Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_QUIT_KICK_SPECTATING);
-                       dropclient(this);
-                       return;
+                       if (dropclient_schedule(this))
+                               Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_QUIT_KICK_SPECTATING);
                }
        }
 
@@ -2701,7 +2700,7 @@ void PlayerPostThink (entity this)
        if (autocvar_sv_maxidle > 0 || (IS_PLAYER(this) && autocvar_sv_maxidle_playertospectator > 0))
        if (frametime) // WORKAROUND: only use dropclient in server frames (frametime set). Never use it in cl_movement frames (frametime zero).
        if (IS_REAL_CLIENT(this))
-       if (IS_PLAYER(this) || autocvar_sv_maxidle_spectatorsareidle)
+       if (IS_PLAYER(this) || autocvar_sv_maxidle_alsokickspectators)
        if (!intermission_running) // NextLevel() kills all centerprints after setting this true
        {
                int totalClients = 0;
@@ -2747,8 +2746,8 @@ void PlayerPostThink (entity this)
                                }
                                else
                                {
-                                       Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_KICK_IDLING, this.netname, maxidle_time);
-                                       dropclient(this);
+                                       if (dropclient_schedule(this))
+                                               Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_KICK_IDLING, this.netname, maxidle_time);
                                }
                                return;
                        }