]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Consider unconnected players in Ban_Enforce
authorMattia Basaglia <mattia.basaglia@gmail.com>
Sat, 17 Jan 2015 10:02:16 +0000 (11:02 +0100)
committerMattia Basaglia <mattia.basaglia@gmail.com>
Sat, 17 Jan 2015 10:02:16 +0000 (11:02 +0100)
qcsrc/server/ipban.qc

index 9f044b958a921900f6b2b3e6cea1fef3389e26be..b7ea0cc2f330051e670bef11de8eaa45922ce085 100644 (file)
@@ -469,7 +469,8 @@ string Ban_Enforce(float i, string reason)
 
        // Enforce our new ban
        s = "";
-       FOR_EACH_REALCLIENT(e)
+       for(e = world; (e = nextent(e)) && (num_for_edict(e) <= maxclients); )
+               if (IS_REAL_CLIENT(e))
                if(Ban_IsClientBanned(e, i))
                {
                        if(reason != "")
@@ -604,7 +605,6 @@ void Ban_KickBanClient(entity client, float bantime, float masksize, string reas
         * not needed, as we enforce the ban in Ban_Insert anyway
        // and kick him
        sprint(client, strcat("Kickbanned: ", reason, "\n"));
+       dropclient(client);
         */
-       if (IS_REAL_CLIENT(client))
-               dropclient(client);
 }