Skip to content

Commit

Permalink
- saved the wrong version.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Apr 25, 2017
1 parent 090502b commit f866e0f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/g_level.cpp
Expand Up @@ -86,6 +86,7 @@
#include "serializer.h"
#include "vm.h"
#include "events.h"
#include "dobjgc.h"

#include "gi.h"

Expand Down Expand Up @@ -1019,7 +1020,7 @@ void G_DoLoadLevel (int position, bool autosave)
level.starttime = gametic;

G_UnSnapshotLevel (!savegamerestore); // [RH] Restore the state of the level.
G_FinishTravel ();
int pnumerr = G_FinishTravel ();
// For each player, if they are viewing through a player, make sure it is themselves.
for (int ii = 0; ii < MAXPLAYERS; ++ii)
{
Expand Down Expand Up @@ -1061,6 +1062,10 @@ void G_DoLoadLevel (int position, bool autosave)
{
DAutosaver GCCNOWARN *dummy = Create<DAutosaver>();
}
if (pnumerr > 0)
{
I_Error("no start for player %d found.", pnumerr);
}
}


Expand Down Expand Up @@ -1224,13 +1229,14 @@ void G_StartTravel ()
//
//==========================================================================

void G_FinishTravel ()
int G_FinishTravel ()
{
TThinkerIterator<APlayerPawn> it (STAT_TRAVELLING);
APlayerPawn *pawn, *pawndup, *oldpawn, *next;
AInventory *inv;
FPlayerStart *start;
int pnum;
int failnum = 0;

//
APlayerPawn* pawns[MAXPLAYERS];
Expand All @@ -1257,8 +1263,7 @@ void G_FinishTravel ()
else
{
// Could not find a start for this player at all. This really should never happen but if it does, let's better abort.
DThinker::DestroyThinkersInList(STAT_TRAVELLING);
I_Error ("No player %d start to travel to!\n", pnum + 1);
if (failnum == 0) failnum = pnum + 1;
}
}
oldpawn = pawndup;
Expand Down Expand Up @@ -1286,7 +1291,7 @@ void G_FinishTravel ()
pawn->Floorclip = pawndup->Floorclip;
pawn->waterlevel = pawndup->waterlevel;
}
else
else if (failnum == 0) // In the failure case this may run into some undefined data.
{
P_FindFloorCeiling(pawn);
}
Expand Down Expand Up @@ -1336,6 +1341,7 @@ void G_FinishTravel ()
// Since this list is excluded from regular thinker cleaning, anything that may survive through here
// will endlessly multiply and severely break the following savegames or just simply crash on broken pointers.
DThinker::DestroyThinkersInList(STAT_TRAVELLING);
return failnum;
}

//==========================================================================
Expand Down

0 comments on commit f866e0f

Please sign in to comment.