]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/spawnpoints.qc
Merge branch 'terencehill/camera_spectator_2' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / spawnpoints.qc
index c71ce1d312a104bf6160575b7e940c5041a238d3..4be19b879d317ac5976bbe87f3c70cd7f1870e93 100644 (file)
@@ -249,17 +249,15 @@ vector Spawn_Score(entity this, entity spot, float mindist, float teamcheck)
        vector spawn_score = prio * '1 0 0' + shortest * '0 1 0';
 
        // filter out spots for assault
-       if(spot.target != "") {
-               entity ent;
-               float found;
-
-               found = 0;
-               for(ent = world; (ent = find(ent, targetname, spot.target)); )
+       if(spot.target != "")
+       {
+               int found = 0;
+               for(entity targ = findchain(targetname, spot.target); targ; targ = targ.chain)
                {
                        ++found;
-                       if(ent.spawn_evalfunc)
+                       if(targ.spawn_evalfunc)
                        {
-                               spawn_score = ent.spawn_evalfunc(ent, this, spot, spawn_score);
+                               spawn_score = targ.spawn_evalfunc(targ, this, spot, spawn_score);
                                if(spawn_score.x < 0)
                                        return spawn_score;
                        }
@@ -288,8 +286,8 @@ entity Spawn_FilterOutBadSpots(entity this, entity firstspot, float mindist, flo
 {
        entity spot, spotlist, spotlistend;
 
-       spotlist = world;
-       spotlistend = world;
+       spotlist = NULL;
+       spotlistend = NULL;
 
        Spawn_ScoreAll(this, firstspot, mindist, teamcheck);
 
@@ -305,7 +303,7 @@ entity Spawn_FilterOutBadSpots(entity this, entity firstspot, float mindist, flo
                }
        }
        if(spotlistend)
-               spotlistend.chain = world;
+               spotlistend.chain = NULL;
 
        return spotlist;
 }
@@ -335,7 +333,7 @@ entity SelectSpawnPoint(entity this, bool anypoint)
        float teamcheck;
        entity spot, firstspot;
 
-       spot = find (world, classname, "testplayerstart");
+       spot = find (NULL, classname, "testplayerstart");
        if (spot)
                return spot;
 
@@ -392,7 +390,7 @@ entity SelectSpawnPoint(entity this, bool anypoint)
                else
                {
                        if(some_spawn_has_been_used)
-                               return world; // team can't spawn any more, because of actions of other team
+                               return NULL; // team can't spawn any more, because of actions of other team
                        else
                                error("Cannot find a spawn point - please fix the map!");
                }