index 194b8337a06813310aacb4a7b39a808fbdc8da02..a7477581a189541fd1de6a9ea8f0530f44d99ef8 100644 (file)
--- a/src/game/g_saveload.pas
+++ b/src/game/g_saveload.pas
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * the Free Software Foundation, version 3 of the License ONLY.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
st.Free();
end;
except
+ on e: EFileNotFoundException do
+ begin
+ g_Console_Add(_lc[I_GAME_ERROR_LOAD]);
+ g_Console_Add('LoadState Error: '+e.message);
+ e_WriteLog('LoadState Error: '+e.message, TMsgType.Warning);
+ gLoadGameMode := false;
+ result := false;
+ end;
on e: Exception do
begin
g_Console_Add(_lc[I_GAME_ERROR_LOAD]);
+ g_Console_Add('LoadState Error: '+e.message);
e_WriteLog('LoadState Error: '+e.message, TMsgType.Warning);
{$IF DEFINED(D2F_DEBUG)}e_LogWritefln('stream error position: 0x%08x', [errpos], TMsgType.Warning);{$ENDIF}
gLoadGameMode := false;
result := false;
- if not gameCleared then g_Game_Free();
+ if gState <> STATE_MENU then
+ g_FatalError(_lc[I_GAME_ERROR_LOAD])
+ else if not gameCleared then
+ g_Game_Free();
{$IF DEFINED(D2F_DEBUG)}e_WriteStackTrace(e.message);{$ENDIF}
end;
end;