Game still needs to abort if no starts exist at all

This commit is contained in:
Edward Richardson 2016-01-30 22:26:47 +13:00
parent c1e362ee83
commit 40d90ba325
2 changed files with 7 additions and 2 deletions

View file

@ -1575,6 +1575,11 @@ void G_DeathMatchSpawnPlayer (int playernum)
// //
FPlayerStart *G_PickPlayerStart(int playernum, int flags) 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) || if ((level.flags2 & LEVEL2_RANDOMPLAYERSTARTS) || (flags & PPS_FORCERANDOM) ||
playerstarts[playernum].type == 0) playerstarts[playernum].type == 0)
{ {

View file

@ -1209,8 +1209,8 @@ void G_FinishTravel ()
assert (pawn != pawndup); assert (pawn != pawndup);
if (pawndup == NULL) if (pawndup == NULL)
{ // Oh no! there was no start for this player! { // Oh no! there was no start for this player!
start = G_PickPlayerStart(pnum, PPS_FORCERANDOM); start = G_PickPlayerStart(pnum, PPS_FORCERANDOM);
pawndup = P_SpawnPlayer(start, pnum, (level.flags2 & LEVEL2_PRERAISEWEAPON) ? SPF_WEAPONFULLYUP : 0); if (start != NULL) pawndup = P_SpawnPlayer(start, pnum, (level.flags2 & LEVEL2_PRERAISEWEAPON) ? SPF_WEAPONFULLYUP : 0);
if (pawndup == NULL) if (pawndup == NULL)
{ {
pawn->flags |= MF_NOSECTOR | MF_NOBLOCKMAP; pawn->flags |= MF_NOSECTOR | MF_NOBLOCKMAP;