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;
+ FOREACH_ENTITY_STRING(targetname, spot.target,
{
++found;
- if(ent.spawn_evalfunc)
+ if(it.spawn_evalfunc)
{
- spawn_score = ent.spawn_evalfunc(ent, this, spot, spawn_score);
+ spawn_score = it.spawn_evalfunc(it, this, spot, spawn_score);
if(spawn_score.x < 0)
return spawn_score;
}
- }
+ });
if(!found)
{
{
entity spot, spotlist, spotlistend;
- spotlist = world;
- spotlistend = world;
+ spotlist = NULL;
+ spotlistend = NULL;
Spawn_ScoreAll(this, firstspot, mindist, teamcheck);
}
}
if(spotlistend)
- spotlistend.chain = world;
+ spotlistend.chain = NULL;
return spotlist;
}
float teamcheck;
entity spot, firstspot;
- spot = find (world, classname, "testplayerstart");
+ spot = find (NULL, classname, "testplayerstart");
if (spot)
return spot;
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!");
}