]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_client.qc
Merge remote-tracking branch 'origin/terencehill/g_changeteam_banned_fix'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_client.qc
index 9d220fc12be68e80ee4ce303907f8cdcdb41e9d9..3d393755a0f3749d33793dc7b6de1e574c1284c2 100644 (file)
@@ -158,11 +158,11 @@ vector Spawn_Score(entity spot, float mindist, float teamcheck)
                if (thisdist < shortest)
                        shortest = thisdist;
        }
-       if(shortest < mindist)
+       if(shortest > mindist)
                prio += SPAWN_PRIO_GOOD_DISTANCE;
 
        spawn_score = prio * '1 0 0' + shortest * '0 1 0';
-       spawn_score_spot = spot;
+       spawn_spot = spot;
 
        // filter out spots for assault
        if(spot.target != "") {
@@ -996,12 +996,6 @@ void PutClientInServer (void)
 
                race_PostSpawn(spot);
 
-               if(autocvar_spawn_debug)
-               {
-                       sprint(self, strcat("spawnpoint origin:  ", vtos(spot.origin), "\n"));
-                       remove(spot);   // usefull for checking if there are spawnpoints, that let drop through the floor
-               }
-
                //stuffcmd(self, "chase_active 0");
                //stuffcmd(self, "set viewsize $tmpviewsize \n");
 
@@ -1040,8 +1034,15 @@ void PutClientInServer (void)
                        activator = world;
                self = oldself;
 
+               spawn_spot = spot;
                MUTATOR_CALLHOOK(PlayerSpawn);
 
+               if(autocvar_spawn_debug)
+               {
+                       sprint(self, strcat("spawnpoint origin:  ", vtos(spot.origin), "\n"));
+                       remove(spot);   // usefull for checking if there are spawnpoints, that let drop through the floor
+               }
+
                self.switchweapon = w_getbestweapon(self);
                self.cnt = -1; // W_LastWeapon will not complain
                self.weapon = 0;
@@ -1050,6 +1051,8 @@ void PutClientInServer (void)
 
                if(!self.alivetime)
                        self.alivetime = time;
+
+               antilag_clear(self);
        } else if(self.classname == "observer" || (g_ca && !allowed_to_spawn)) {
                PutObserverInServer ();
        }