]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/spawnpoints.qc
Merge branch 'martin-t/ctf-autoreturn' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / spawnpoints.qc
index e0e33e4803c87445641359a8c76824cc821a19a8..730c92884f75b09ddf7ff1cf890a610272ad084e 100644 (file)
@@ -7,6 +7,7 @@
 #include "../common/constants.qh"
 #include <common/net_linked.qh>
 #include "../common/teams.qh"
+#include <common/mapinfo.qh>
 #include "../common/mapobjects/subs.qh"
 #include "../common/mapobjects/target/spawnpoint.qh"
 #include "../common/util.qh"
@@ -248,7 +249,7 @@ 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 != "")
+       if(spot.target && spot.target != "")
        {
                int found = 0;
                for(entity targ = findchain(targetname, spot.target); targ; targ = targ.chain)
@@ -262,7 +263,7 @@ vector Spawn_Score(entity this, entity spot, float mindist, float teamcheck)
                        }
                }
 
-               if(!found)
+               if(!found && !g_cts)
                {
                        LOG_TRACE("WARNING: spawnpoint at ", vtos(spot.origin), " could not find its target ", spot.target);
                        return '-1 0 0';