- removed some more hubtravel related player start fudging.
* do not skip the player_t init when travelling in a hub. The old player may still be needed in some edge cases. This applies only to singleplayer for now. The multiplayer version still needs reviewing. I left it alone because it may shuffle players around which is not wanted when doing hub travelling. * do not spawn two temp players in G_FinishTravel. Instead handle the case where no player_t::mo can be found gracefully by adding a few nullptr checks. This temp player served no real purpose except for having a valid pointer. The actual start position was retrieved from somewhere else.
This commit is contained in:
parent
74b8e9f286
commit
6a6a0e8017
2 changed files with 17 additions and 23 deletions
|
|
@ -537,7 +537,7 @@ void P_SerializeSounds(FSerializer &arc)
|
|||
//==========================================================================
|
||||
|
||||
void CopyPlayer(player_t *dst, player_t *src, const char *name);
|
||||
static void ReadOnePlayer(FSerializer &arc, bool skipload);
|
||||
static void ReadOnePlayer(FSerializer &arc);
|
||||
static void ReadMultiplePlayers(FSerializer &arc, int numPlayers, int numPlayersNow, bool skipload);
|
||||
static void SpawnExtraPlayers();
|
||||
|
||||
|
|
@ -594,7 +594,7 @@ void P_SerializePlayers(FSerializer &arc, bool skipload)
|
|||
// first player present, no matter what their name.
|
||||
if (numPlayers == 1)
|
||||
{
|
||||
ReadOnePlayer(arc, skipload);
|
||||
ReadOnePlayer(arc);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -617,7 +617,7 @@ void P_SerializePlayers(FSerializer &arc, bool skipload)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
static void ReadOnePlayer(FSerializer &arc, bool skipload)
|
||||
static void ReadOnePlayer(FSerializer &arc)
|
||||
{
|
||||
int i;
|
||||
const char *name = NULL;
|
||||
|
|
@ -636,10 +636,7 @@ static void ReadOnePlayer(FSerializer &arc, bool skipload)
|
|||
didIt = true;
|
||||
player_t playerTemp;
|
||||
playerTemp.Serialize(arc);
|
||||
if (!skipload)
|
||||
{
|
||||
CopyPlayer(&players[i], &playerTemp, name);
|
||||
}
|
||||
CopyPlayer(&players[i], &playerTemp, name);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue