From 40d90ba325d9c34c6425ff2aad62a4dc85cb96c0 Mon Sep 17 00:00:00 2001 From: Edward Richardson Date: Sat, 30 Jan 2016 22:26:47 +1300 Subject: [PATCH] Game still needs to abort if no starts exist at all --- src/g_game.cpp | 5 +++++ src/g_level.cpp | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/g_game.cpp b/src/g_game.cpp index 091065b0a..7ca8b2b35 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1575,6 +1575,11 @@ void G_DeathMatchSpawnPlayer (int playernum) // FPlayerStart *G_PickPlayerStart(int playernum, int flags) { + if (AllPlayerStarts.Size() == 0) // No starts to pick + { + return NULL; + } + if ((level.flags2 & LEVEL2_RANDOMPLAYERSTARTS) || (flags & PPS_FORCERANDOM) || playerstarts[playernum].type == 0) { diff --git a/src/g_level.cpp b/src/g_level.cpp index 6ec7f9958..d799cc893 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1209,8 +1209,8 @@ void G_FinishTravel () assert (pawn != pawndup); if (pawndup == NULL) { // Oh no! there was no start for this player! - start = G_PickPlayerStart(pnum, PPS_FORCERANDOM); - pawndup = P_SpawnPlayer(start, pnum, (level.flags2 & LEVEL2_PRERAISEWEAPON) ? SPF_WEAPONFULLYUP : 0); + start = G_PickPlayerStart(pnum, PPS_FORCERANDOM); + if (start != NULL) pawndup = P_SpawnPlayer(start, pnum, (level.flags2 & LEVEL2_PRERAISEWEAPON) ? SPF_WEAPONFULLYUP : 0); if (pawndup == NULL) { pawn->flags |= MF_NOSECTOR | MF_NOBLOCKMAP;