move the old "can't load the level" error to its proper place, added specific error messages for all the times that unarchiving Lua banks can fail

# Conflicts:
#	src/d_clisrv.c
This commit is contained in:
toaster 2022-03-18 13:07:47 +00:00
parent 1219f36ca2
commit c67b52f85d
2 changed files with 14 additions and 8 deletions

View file

@ -1276,10 +1276,6 @@ static void CL_LoadReceivedSavegame(boolean reloading)
CON_LogMessage("\"\n");
}
}
else
{
CONS_Alert(CONS_ERROR, M_GetText("Can't load the level!\n"));
}
// done
Z_Free(savebuffer);

View file

@ -4525,7 +4525,10 @@ static inline boolean P_NetUnArchiveMisc(boolean reloading)
encoremode = (boolean)READUINT8(save_p);
if (!P_LoadLevel(true, reloading))
{
CONS_Alert(CONS_ERROR, M_GetText("Can't load the level!\n"));
return false;
}
// get the time
leveltime = READUINT32(save_p);
@ -4652,19 +4655,26 @@ static inline boolean P_UnArchiveLuabanksAndConsistency(void)
{
switch (READUINT8(save_p))
{
case 0xb7:
case 0xb7: // luabanks marker
{
UINT8 i, banksinuse = READUINT8(save_p);
if (banksinuse > NUM_LUABANKS)
{
CONS_Alert(CONS_ERROR, M_GetText("Corrupt Luabanks! (Too many banks in use)\n"));
return false;
}
for (i = 0; i < banksinuse; i++)
luabanks[i] = READINT32(save_p);
if (READUINT8(save_p) != 0x1d)
if (READUINT8(save_p) != 0x1d) // consistency marker
{
CONS_Alert(CONS_ERROR, M_GetText("Corrupt Luabanks! (Failed consistency check)\n"));
return false;
}
}
case 0x1d:
case 0x1d: // consistency marker
break;
default:
default: // anything else is nonsense
CONS_Alert(CONS_ERROR, M_GetText("Failed consistency check (???)\n"));
return false;
}