Skip to content

Commit

Permalink
make players spawn at any available spawn if one doesn't exist for th…
Browse files Browse the repository at this point in the history
…e mode.
  • Loading branch information
yellowberryHN committed Jan 18, 2024
1 parent ce4ffe4 commit bfca154
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/engine/world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,16 @@ float gatherspawninfos(dynent *d, int tag, vector<spawninfo> &spawninfos)
s.weight = game::ratespawn(d, e);
total += s.weight;
}
if (spawninfos.empty() && !ents.empty()) {
if (tag == 0) { // in FFA mode with team spawns
conoutf(CON_WARN, "\f3no spawns available for neutral players, spawning at team spawn!");
return gatherspawninfos(d, 1, spawninfos) + gatherspawninfos(d, 2, spawninfos);
}
else { // in team mode with FFA spawns
conoutf(CON_WARN, "\f3no spawns available for team players, spawning at neutral spawn!");
return gatherspawninfos(d, 0, spawninfos);
}
}
return total;
}

Expand Down

0 comments on commit bfca154

Please sign in to comment.