]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote-tracking branch 'origin/mirceakitsune/bloom_tweaks'
authorRudolf Polzer <divverent@xonotic.org>
Fri, 25 Nov 2011 11:20:29 +0000 (12:20 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Fri, 25 Nov 2011 11:20:29 +0000 (12:20 +0100)
qcsrc/server/cl_client.qc
qcsrc/server/g_world.qc

index 7445c6b38b0cf5f2c4f4f43ea47ea3cf11ab1efc..b56add1c76ab8f5f2709fc5f67185d9fb4f05699 100644 (file)
@@ -155,34 +155,33 @@ vector Spawn_Score(entity spot, entity playerlist, float teamcheck, float anypoi
        if(spot.target != "") {
                entity ent;
                float good, found;
-               ent = find(world, targetname, spot.target);
 
-               while(ent) {
+               found = 0;
+               good = 0;
+               for(ent = world; (ent = find(ent, targetname, spot.target)); )
+               {
+                       ++found;
                        if(ent.classname == "target_objective")
                        {
-                               found = 1;
                                if(ent.health < 0 || ent.health >= ASSAULT_VALUE_INACTIVE)
-                                       return '-1 0 0';
-                               good = 1;
+                                       continue;
                        }
                        else if(ent.classname == "trigger_race_checkpoint")
                        {
-                               found = 1;
                                if(!anypoint) // spectators may spawn everywhere
-
                                {
                                        if(g_race_qualifying)
                                        {
                                                // spawn at first
                                                if(ent.race_checkpoint != 0)
-                                                       return '-1 0 0';
+                                                       continue;
                                                if(spot.race_place != race_lowest_place_spawn)
-                                                       return '-1 0 0';
+                                                       continue;
                                        }
                                        else
                                        {
                                                if(ent.race_checkpoint != self.race_respawn_checkpoint)
-                                                       return '-1 0 0';
+                                                       continue;
                                                // try reusing the previous spawn
                                                if(ent == self.race_respawn_spotref || spot == self.race_respawn_spotref)
                                                        prio += 1;
@@ -195,16 +194,21 @@ vector Spawn_Score(entity spot, entity playerlist, float teamcheck, float anypoi
                                                        if(pl == 0 && !self.race_started)
                                                                pl = race_highest_place_spawn; // use last place if he has not even touched finish yet
                                                        if(spot.race_place != pl)
-                                                               return '-1 0 0';
+                                                               continue;
                                                }
                                        }
                                }
-                               good = 1;
                        }
-                       ent = find(ent, targetname, spot.target);
+                       ++good;
+               }
+
+               if(!found)
+               {
+                       dprint("WARNING: spawnpoint at ", vtos(spot.origin), " could not find its target ", spot.target, "\n");
+                       return '-1 0 0';
                }
 
-               if(found && !good)
+               if(good < found) // at least one was bad
                        return '-1 0 0';
        }
 
@@ -1691,9 +1695,6 @@ void ClientConnect (void)
        // Wazat's grappling hook
        SetGrappleHookBindings();
 
-       // get autoswitch state from player when he toggles it
-       stuffcmd(self, "alias autoswitch \"set cl_autoswitch $1 ; cmd autoswitch $1\"\n"); // default.cfg-ed in 2.4.1
-
        // get version info from player
        stuffcmd(self, "cmd clientversion $gameversion\n");
 
index 5c326b8e6213ce96361b02b368b7b552231f1d60..c398825b2b3963e223ec902f231e74cfd63470b4 100644 (file)
@@ -788,22 +788,22 @@ void spawnfunc_worldspawn (void)
                                        continue;
                                if(argv(0) == "cd")
                                {
-                                       print("Found ^1DEPRECATED^7 cd loop command in .cfg file; put this line in mapinfo instead:\n");
+                                       print("Found ^1UNSUPPORTED^7 cd loop command in .cfg file; put this line in mapinfo instead:\n");
                                        print("  cdtrack ", argv(2), "\n");
                                }
                                else if(argv(0) == "fog")
                                {
-                                       print("Found ^1DEPRECATED^7 fog command in .cfg file; put this line in worldspawn in the .map/.bsp/.ent file instead:\n");
+                                       print("Found ^1UNSUPPORTED^7 fog command in .cfg file; put this line in worldspawn in the .map/.bsp/.ent file instead:\n");
                                        print("  \"fog\" \"", s, "\"\n");
                                }
                                else if(argv(0) == "set")
                                {
-                                       print("Found ^1DEPRECATED^7 set command in .cfg file; put this line in mapinfo instead:\n");
+                                       print("Found ^1UNSUPPORTED^7 set command in .cfg file; put this line in mapinfo instead:\n");
                                        print("  clientsettemp_for_type all ", argv(1), " ", argv(2), "\n");
                                }
                                else if(argv(0) != "//")
                                {
-                                       print("Found ^1DEPRECATED^7 set command in .cfg file; put this line in mapinfo instead:\n");
+                                       print("Found ^1UNSUPPORTED^7 set command in .cfg file; put this line in mapinfo instead:\n");
                                        print("  clientsettemp_for_type all ", argv(0), " ", argv(1), "\n");
                                }
                        }
@@ -1273,11 +1273,7 @@ float DoNextMapOverride()
        }
        if (autocvar_samelevel) // if samelevel is set, stay on same level
        {
-               // this does not work because it tries to exec maps/nexdm01.mapcfg (which doesn't exist, it should be trying maps/dm_nexdm01.mapcfg for example)
-               //localcmd(strcat("exec \"maps/", mapname, ".mapcfg\"\n"));
-               // so instead just restart the current map using the restart command (DOES NOT WORK PROPERLY WITH exit_cfg STUFF)
                localcmd("restart\n");
-               //changelevel (mapname);
                alreadychangedlevel = TRUE;
                return TRUE;
        }