Fixed: Co-op players could spawn at (0,0) if no start spots for them
- Check if a co-op start exists. If not, pick one at random. - Don't telefrag other players when spawning in co-op games, since you're allowed to move out of other players now.
This commit is contained in:
parent
058bfdea26
commit
87dee5c611
3 changed files with 12 additions and 7 deletions
|
|
@ -1557,7 +1557,7 @@ void G_DeathMatchSpawnPlayer (int playernum)
|
|||
if (spot == NULL)
|
||||
{ // We have a player 1 start, right?
|
||||
spot = &playerstarts[0];
|
||||
if (spot == NULL)
|
||||
if (spot->type == 0)
|
||||
{ // Fine, whatever.
|
||||
spot = &deathmatchstarts[0];
|
||||
}
|
||||
|
|
@ -1573,7 +1573,8 @@ void G_DeathMatchSpawnPlayer (int playernum)
|
|||
//
|
||||
FPlayerStart *G_PickPlayerStart(int playernum, int flags)
|
||||
{
|
||||
if ((level.flags2 & LEVEL2_RANDOMPLAYERSTARTS) || (flags & PPS_FORCERANDOM))
|
||||
if ((level.flags2 & LEVEL2_RANDOMPLAYERSTARTS) || (flags & PPS_FORCERANDOM) ||
|
||||
playerstarts[playernum].type == 0)
|
||||
{
|
||||
if (!(flags & PPS_NOBLOCKINGCHECK))
|
||||
{
|
||||
|
|
@ -1592,7 +1593,7 @@ FPlayerStart *G_PickPlayerStart(int playernum, int flags)
|
|||
{ // Pick an open spot at random.
|
||||
return good_starts[pr_pspawn(good_starts.Size())];
|
||||
}
|
||||
}
|
||||
}
|
||||
// Pick a spot at random, whether it's open or not.
|
||||
return &AllPlayerStarts[pr_pspawn(AllPlayerStarts.Size())];
|
||||
}
|
||||
|
|
@ -1665,16 +1666,17 @@ void G_DoReborn (int playernum, bool freshbot)
|
|||
}
|
||||
|
||||
if (!(level.flags2 & LEVEL2_RANDOMPLAYERSTARTS) &&
|
||||
playerstarts[playernum].type != 0 &&
|
||||
G_CheckSpot (playernum, &playerstarts[playernum]))
|
||||
{
|
||||
AActor *mo = P_SpawnPlayer(&playerstarts[playernum], playernum);
|
||||
if (mo != NULL) P_PlayerStartStomp(mo);
|
||||
if (mo != NULL) P_PlayerStartStomp(mo, true);
|
||||
}
|
||||
else
|
||||
{ // try to spawn at any random player's spot
|
||||
FPlayerStart *start = G_PickPlayerStart(playernum, PPS_FORCERANDOM);
|
||||
AActor *mo = P_SpawnPlayer(start, playernum);
|
||||
if (mo != NULL) P_PlayerStartStomp(mo);
|
||||
if (mo != NULL) P_PlayerStartStomp(mo, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue