Skip to content

Commit

Permalink
- call P_PlayerStartStomp only when the map is played directly from t…
Browse files Browse the repository at this point in the history
…he loaded data and only when it has been fully loaded.

The old code did this right in the middle of map initialization where not everything had been set up yet.
  • Loading branch information
coelckers committed Jul 15, 2018
1 parent 2c86c4e commit 7c527de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 10 additions & 0 deletions src/g_level.cpp
Expand Up @@ -1045,6 +1045,16 @@ void G_DoLoadLevel (int position, bool autosave)

G_UnSnapshotLevel (!savegamerestore); // [RH] Restore the state of the level.
int pnumerr = G_FinishTravel ();

if (!level.FromSnapshot)
{
for (int i = 0; i<MAXPLAYERS; i++)
{
if (playeringame[i] && players[i].mo != NULL)
P_PlayerStartStomp(players[i].mo);
}
}

// For each player, if they are viewing through a player, make sure it is themselves.
for (int ii = 0; ii < MAXPLAYERS; ++ii)
{
Expand Down
5 changes: 0 additions & 5 deletions src/p_setup.cpp
Expand Up @@ -1845,11 +1845,6 @@ void P_SpawnThings (int position)
SetMapThingUserData(actor, *udi);
}
}
for(int i=0; i<MAXPLAYERS; i++)
{
if (playeringame[i] && players[i].mo != NULL)
P_PlayerStartStomp(players[i].mo);
}
}


Expand Down

0 comments on commit 7c527de

Please sign in to comment.