From 6f605e00371ad0be6179b1aa966c509504142662 Mon Sep 17 00:00:00 2001 From: dashodanger Date: Fri, 11 Oct 2024 14:50:53 -0600 Subject: [PATCH] Allow co-op bots to spawn regardless of co-op player starts --- source_files/edge/e_player.cc | 5 ++++- source_files/edge/m_netgame.cc | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/source_files/edge/e_player.cc b/source_files/edge/e_player.cc index a0d57cb68..2a8407b44 100644 --- a/source_files/edge/e_player.cc +++ b/source_files/edge/e_player.cc @@ -500,6 +500,7 @@ void CoopSpawnPlayer(Player *p) int begin = p->player_number_; // try to spawn at one of the other players spots + // if unobstructed for (int j = 0; j < (int)coop_starts.size(); j++) { int i = (begin + j) % (int)coop_starts.size(); @@ -508,7 +509,9 @@ void CoopSpawnPlayer(Player *p) return; } - FatalError("No usable player start found!\n"); + // last resort, just pick one at random (in co-op bots and players + // will not clip or telefrag so this should be fine) + P_SpawnPlayer(p, &coop_starts[RandomByte() % (int)coop_starts.size()], false); } static SpawnPoint *GameFindHubPlayer(int player_number_, int tag) diff --git a/source_files/edge/m_netgame.cc b/source_files/edge/m_netgame.cc index 57fe3631e..599045266 100644 --- a/source_files/edge/m_netgame.cc +++ b/source_files/edge/m_netgame.cc @@ -363,8 +363,8 @@ static void HostChangeOption(int opt, int key) host_want_bots += dir; if (host_want_bots < 0) - host_want_bots = 3; - else if (host_want_bots > 3) + host_want_bots = kMaximumPlayers-1; + else if (host_want_bots > kMaximumPlayers-1) host_want_bots = 0; break;