X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fspawnpoints.qc;h=59cc052af421942def992c27f5103fd3d08d00d8;hb=64c5403b271432150972626d3104064e3ec51f16;hp=f55fb1122aee7e5686b4ee83aa43324da388633c;hpb=10c0e93c75ef6f408e3357bd5fb46c721e7e0576;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/spawnpoints.qc b/qcsrc/server/spawnpoints.qc index f55fb1122..59cc052af 100644 --- a/qcsrc/server/spawnpoints.qc +++ b/qcsrc/server/spawnpoints.qc @@ -1,6 +1,6 @@ #include "spawnpoints.qh" -#include "mutators/all.qh" +#include "mutators/_mod.qh" #include "g_world.qh" #include "race.qh" #include "../common/constants.qh" @@ -166,6 +166,7 @@ spawnfunc(info_player_start) spawnfunc(info_player_deathmatch) { this.classname = "info_player_deathmatch"; + IL_PUSH(g_spawnpoints, this); relocate_spawnpoint(this); } @@ -249,17 +250,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 +266,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'; } } @@ -335,7 +334,7 @@ entity SelectSpawnPoint(entity this, bool anypoint) float teamcheck; entity spot, firstspot; - spot = find (NULL, classname, "testplayerstart"); + spot = find(NULL, classname, "testplayerstart"); if (spot) return spot;