X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_saveload.pas;h=17a186698a26ed0c5cccb2ce8d4f336c4bbb1fd2;hb=01f7c9f6fb35b2b193cb967c2d881ab9fc5b6bcc;hp=ad438f89174172171fa0d05b6b174cc982c5cd20;hpb=d7d166dc3cd287276202e862746208892c4cc89f;p=d2df-sdl.git diff --git a/src/game/g_saveload.pas b/src/game/g_saveload.pas index ad438f8..17a1866 100644 --- a/src/game/g_saveload.pas +++ b/src/game/g_saveload.pas @@ -1,4 +1,4 @@ -(* 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 @@ -501,14 +501,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;