Test: Restore save_p after P_LoadLevel

P_LoadLevel calls some functions that save gamedata and
unset save_p.

this is kinda hacky but i perhaps will port the redone save buffer sometime
This commit is contained in:
Alug committed 2024-07-22 19:51:56 +02:00
1 parent 3d0ac03f06
commit f97fe4bd65
1 file changed
+6
+6
View File
@@ -3362,6 +3362,7 @@ FUNCINLINE static ATTRINLINE boolean P_NetUnArchiveMisc(boolean reloading)
{
UINT32 pig;
INT32 i;
UINT8 *old_save_p;
if (READUINT32(save_p) != ARCHIVEBLOCK_MISC)
I_Error("Bad $$$.sav at archive block Misc");
@@ -3399,12 +3400,17 @@ FUNCINLINE static ATTRINLINE boolean P_NetUnArchiveMisc(boolean reloading)
encoremode = (boolean)READUINT8(save_p);
// FIXME: save_p should not be global!!!
old_save_p = save_p;
if (!P_SetupLevel(true, reloading))
{
CONS_Alert(CONS_ERROR, M_GetText("Can't load the level!\n"));
return false;
}
save_p = old_save_p;
// get the time
leveltime = READUINT32(save_p);
totalrings = READUINT32(save_p);