Skip to content

Commit 7f826a6

Browse files
Fix for quickload bug (#522)
Co-authored-by: Karjala22 <78927981+Karjala22@users.noreply.github.com>
1 parent a81f414 commit 7f826a6

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

TheForceEngine/TFE_Game/saveSystem.cpp

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#include "saveSystem.h"
2-
#include <TFE_Input/inputMapping.h>
3-
#include <TFE_System/system.h>
4-
#include <TFE_Settings/gameSourceData.h>
2+
#include <TFE_Asset/imageAsset.h>
3+
#include <TFE_DarkForces/hud.h>
54
#include <TFE_FileSystem/fileutil.h>
6-
5+
#include <TFE_Input/inputMapping.h>
76
#include <TFE_RenderBackend/renderBackend.h>
8-
#include <TFE_Asset/imageAsset.h>
7+
#include <TFE_Settings/gameSourceData.h>
8+
#include <TFE_System/system.h>
99
#include <cassert>
1010
#include <cstring>
1111

@@ -370,8 +370,18 @@ namespace TFE_SaveSystem
370370
}
371371
else if (inputMapping_getActionState(IAS_QUICK_LOAD) == STATE_PRESSED && !lastState)
372372
{
373-
postLoadRequest(c_quickSaveName);
374-
lastState = 1;
373+
char filePath[TFE_MAX_PATH];
374+
sprintf(filePath, "%s%s", s_gameSavePath, c_quickSaveName);
375+
if (FileUtil::exists(filePath))
376+
{
377+
postLoadRequest(c_quickSaveName);
378+
lastState = 1;
379+
}
380+
else
381+
{
382+
TFE_DarkForces::hud_sendTextMessage("No Quicksave Found", 0, false);
383+
lastState = 0;
384+
}
375385
}
376386
else
377387
{

0 commit comments

Comments
 (0)