]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/spawnpoints.qc
Implement move_qcphysics
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / spawnpoints.qc
index f55fb1122aee7e5686b4ee83aa43324da388633c..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 = 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;
                        }