X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_saveload.pas;h=a7477581a189541fd1de6a9ea8f0530f44d99ef8;hb=645d02199259b5e43745df45f027c46e09293dbe;hp=ad438f89174172171fa0d05b6b174cc982c5cd20;hpb=d7d166dc3cd287276202e862746208892c4cc89f;p=d2df-sdl.git diff --git a/src/game/g_saveload.pas b/src/game/g_saveload.pas index ad438f8..a747758 100644 --- a/src/game/g_saveload.pas +++ b/src/game/g_saveload.pas @@ -1,9 +1,8 @@ -(* Copyright (C) DooM 2D:Forever Developers +(* Copyright (C) Doom 2D: Forever Developers * * 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 @@ -501,14 +500,26 @@ begin 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 := true; - if not gameCleared then g_Game_Free(); + result := false; + 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;