Skip to content

Commit

Permalink
Allow co-op bots to spawn regardless of co-op player starts
Browse files Browse the repository at this point in the history
  • Loading branch information
dashodanger committed Oct 11, 2024
1 parent 797f952 commit 6f605e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion source_files/edge/e_player.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions source_files/edge/m_netgame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6f605e0

Please sign in to comment.