From 6e278c1138b465f9903a8af58e56e062ecc7e292 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 30 Nov 2019 15:52:41 +0000 Subject: [PATCH] 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. --- src/p_setup.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index 2216334e7..47262ec5a 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -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;