mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
- fixed savegame loading in Blood.
This commit is contained in:
parent
ba117554b0
commit
def63209be
2 changed files with 12 additions and 6 deletions
|
@ -440,15 +440,19 @@ void MyLoadSave::Save(void)
|
|||
|
||||
void LoadSavedInfo(void)
|
||||
{
|
||||
FString path = M_GetSavegamesPath() + "%sgame*.sav";
|
||||
FString path = M_GetSavegamesPath() + "game*.sav";
|
||||
TArray<FString> saves;
|
||||
D_AddWildFile(saves, path);
|
||||
int nCount = 0;
|
||||
for (auto & savename : saves)
|
||||
{
|
||||
auto hFile = fopenFileReader(savename, 0);
|
||||
OpenSaveGameForRead(savename);
|
||||
auto hFile = ReadSavegameChunk("snapshot.bld");
|
||||
if (!hFile.isOpen())
|
||||
{
|
||||
FinishSavegameRead();
|
||||
ThrowError("Error loading save file header.");
|
||||
}
|
||||
int vc;
|
||||
short v4;
|
||||
vc = 0;
|
||||
|
@ -471,6 +475,7 @@ void LoadSavedInfo(void)
|
|||
strcpy(strRestoreGameStrings[gSaveGameOptions[nCount].nSaveGameSlot], gSaveGameOptions[nCount].szUserGameName);
|
||||
nCount++;
|
||||
}
|
||||
FinishSavegameRead();
|
||||
}
|
||||
|
||||
void UpdateSavedInfo(int nSlot)
|
||||
|
|
|
@ -41,6 +41,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
#include "screen.h"
|
||||
#include "sound.h"
|
||||
#include "view.h"
|
||||
#include "cmdlib.h"
|
||||
#include "i_specialpaths.h"
|
||||
|
||||
EXTERN_CVAR(Bool, hud_powerupduration)
|
||||
|
@ -2120,7 +2121,7 @@ void LoadGame(CGameMenuItemZEditBitmap *pItem, CGameMenuEvent *event)
|
|||
if (gGameOptions.nGameType > 0)
|
||||
return;
|
||||
snprintf(strLoadGameName, BMAX_PATH, "%sgame00%02d.sav", M_GetSavegamesPath().GetChars(), nSlot);
|
||||
if (!testkopen(strLoadGameName, 0))
|
||||
if (!FileExists(strLoadGameName))
|
||||
return;
|
||||
viewLoadingScreen(2518, "Loading", "Loading Saved Game", strRestoreGameStrings[nSlot]);
|
||||
videoNextPage();
|
||||
|
@ -2135,7 +2136,7 @@ void QuickLoadGame(void)
|
|||
if (gGameOptions.nGameType > 0)
|
||||
return;
|
||||
snprintf(strLoadGameName, BMAX_PATH, "%sgame00%02d.sav", M_GetSavegamesPath().GetChars(), gQuickLoadSlot);
|
||||
if (!testkopen(strLoadGameName, 0))
|
||||
if (!FileExists(strLoadGameName))
|
||||
return;
|
||||
viewLoadingScreen(2518, "Loading", "Loading Saved Game", strRestoreGameStrings[gQuickLoadSlot]);
|
||||
videoNextPage();
|
||||
|
|
Loading…
Reference in a new issue