Change the order of operations such that savedata info is loaded before mapthings are spawned, so that if you have all the emeralds, the emerald objects won't spawn in BCZ2 if you use the SP savefile's level select to go to it directly.

This commit is contained in:
toaster 2019-11-30 15:52:41 +00:00
parent bc00380aa4
commit 6e278c1138
1 changed files with 11 additions and 12 deletions

View File

@ -2862,6 +2862,17 @@ boolean P_SetupLevel(boolean skipprecip)
loadprecip = 0;
loademblems = 0;
}
else if (savedata.lives > 0)
{
numgameovers = savedata.numgameovers;
players[consoleplayer].continues = savedata.continues;
players[consoleplayer].lives = savedata.lives;
players[consoleplayer].score = savedata.score;
if ((botingame = ((botskin = savedata.botskin) != 0)))
botcolor = skins[botskin-1].prefcolor;
emeralds = savedata.emeralds;
savedata.lives = 0;
}
// internal game map
maplumpname = G_BuildMapName(gamemap);
@ -3225,18 +3236,6 @@ boolean P_SetupLevel(boolean skipprecip)
lastmaploaded = gamemap; // HAS to be set after saving!!
if (savedata.lives > 0)
{
numgameovers = savedata.numgameovers;
players[consoleplayer].continues = savedata.continues;
players[consoleplayer].lives = savedata.lives;
players[consoleplayer].score = savedata.score;
if ((botingame = ((botskin = savedata.botskin) != 0)))
botcolor = skins[botskin-1].prefcolor;
emeralds = savedata.emeralds;
savedata.lives = 0;
}
if (loadprecip) // uglier hack
{ // to make a newly loaded level start on the second frame.
INT32 buf = gametic % BACKUPTICS;