Allow old version savegames to "load" by just starting a new game on the volume, level and skill written in the savegame header.

git-svn-id: https://svn.eduke32.com/eduke32@4596 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2014-09-30 04:03:30 +00:00
parent cd713abf1e
commit 0d68e1d4a9

View file

@ -242,7 +242,7 @@ int32_t G_LoadPlayer(int32_t spot)
ready2send = 0; ready2send = 0;
i = sv_loadheader(fil, spot, &h); i = sv_loadheader(fil, spot, &h);
if (i || h.numplayers!=ud.multimode) if (i && i != 2 || h.numplayers!=ud.multimode)
{ {
if (i == 2 || i == 3) if (i == 2 || i == 3)
P_DoQuote(QUOTE_SAVE_BAD_VERSION, g_player[myconnectindex].ps); P_DoQuote(QUOTE_SAVE_BAD_VERSION, g_player[myconnectindex].ps);
@ -306,16 +306,22 @@ int32_t G_LoadPlayer(int32_t spot)
Bmemcpy(currentboardfilename, boardfilename, BMAX_PATH); Bmemcpy(currentboardfilename, boardfilename, BMAX_PATH);
// read the rest... if (i == 2)
i = sv_loadsnapshot(fil, spot, &h);
if (i)
{ {
// in theory, we could load into an initial dump first and trivially G_NewGame_EnterLevel();
// recover if things go wrong... }
Bsprintf(tempbuf, "Loading save game file \"%s\" failed (code %d), cannot recover.", fn, i); else
G_GameExit(tempbuf); {
// read the rest...
i = sv_loadsnapshot(fil, spot, &h);
if (i)
{
// in theory, we could load into an initial dump first and trivially
// recover if things go wrong...
Bsprintf(tempbuf, "Loading save game file \"%s\" failed (code %d), cannot recover.", fn, i);
G_GameExit(tempbuf);
}
} }
sv_postudload(); // ud.m_XXX = ud.XXX sv_postudload(); // ud.m_XXX = ud.XXX
VM_OnEvent(EVENT_LOADGAME, g_player[myconnectindex].ps->i, myconnectindex, -1, 0); VM_OnEvent(EVENT_LOADGAME, g_player[myconnectindex].ps->i, myconnectindex, -1, 0);