diff --git a/src/g_game.cpp b/src/g_game.cpp index 752b8f930fe..d2f85c11112 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1606,10 +1606,20 @@ void FLevelLocals::DeathMatchSpawnPlayer (int playernum) if (selections < 1) I_Error ("No deathmatch starts"); + bool hasSpawned = false; + for (int i = 0; i < MAXPLAYERS; ++i) + { + if (PlayerInGame(i) && Players[i]->mo != nullptr && Players[i]->health > 0) + { + hasSpawned = true; + break; + } + } + // At level start, none of the players have mobjs attached to them, // so we always use the random deathmatch spawn. During the game, // though, we use whatever dmflags specifies. - if ((dmflags & DF_SPAWN_FARTHEST) && players[playernum].mo) + if ((dmflags & DF_SPAWN_FARTHEST) && hasSpawned) spot = SelectFarthestDeathmatchSpot (selections); else spot = SelectRandomDeathmatchSpot (playernum, selections);