]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/spawnpoints.qc
Merge branch 'TimePath/globalforces' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / spawnpoints.qc
index f55fb1122aee7e5686b4ee83aa43324da388633c..958b0bd6e3a7c7ddf8ebefced698652592d80f19 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 = NULL; (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;
                        }
@@ -267,7 +265,7 @@ vector Spawn_Score(entity this, entity spot, float mindist, float teamcheck)
 
                if(!found)
                {
-                       LOG_TRACE("WARNING: spawnpoint at ", vtos(spot.origin), " could not find its target ", spot.target, "\n");
+                       LOG_TRACE("WARNING: spawnpoint at ", vtos(spot.origin), " could not find its target ", spot.target);
                        return '-1 0 0';
                }
        }