- Fixed: G_DeathMatchSpawnPlayer() would fail to spawn a player when using "spawn furthest" and

all the deathmatch spots are filled and there is no coop start for the specific player to
  fallback on.

SVN r3472 (trunk)
This commit is contained in:
Randy Heit 2012-03-23 02:53:52 +00:00
parent 0c9f6d2e83
commit 43033df455

View file

@ -1503,17 +1503,30 @@ void G_DeathMatchSpawnPlayer (int playernum)
else
spot = SelectRandomDeathmatchSpot (playernum, selections);
if (!spot)
{ // no good spot, so the player will probably get stuck
if (spot == NULL)
{ // No good spot, so the player will probably get stuck.
// We were probably using select farthest above, and all
// the spots were taken.
spot = &playerstarts[playernum];
if (spot == NULL || spot->type == 0)
{ // This map doesn't have enough coop spots for this player
// to use one.
spot = SelectRandomDeathmatchSpot(playernum, selections);
if (spot == NULL)
{ // We have a player 1 start, right?
spot = &playerstarts[0];
if (spot == NULL)
{ // Fine, whatever.
spot = &deathmatchstarts[0];
}
}
}
}
else
{
if (playernum < 4)
spot->type = playernum+1;
else
spot->type = playernum + gameinfo.player5start - 4;
}
if (playernum < 4)
spot->type = playernum+1;
else
spot->type = playernum + gameinfo.player5start - 4;
AActor *mo = P_SpawnPlayer (spot);
if (mo != NULL) P_PlayerStartStomp(mo);