From 99a57df78284d22ac1f888471a63e730a8a157d4 Mon Sep 17 00:00:00 2001 From: DeaDDooMER Date: Sun, 19 Dec 2021 02:33:25 +0300 Subject: [PATCH] saves: fix incorrect map load after failed state load --- src/game/g_saveload.pas | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/game/g_saveload.pas b/src/game/g_saveload.pas index 80fcbfc..9ab4993 100644 --- a/src/game/g_saveload.pas +++ b/src/game/g_saveload.pas @@ -317,7 +317,9 @@ begin e_WriteLog('Loading saved game...', TMsgType.Notify); - {$IF DEFINED(D2F_DEBUG)}try{$ENDIF} +{$IF DEFINED(D2F_DEBUG)} + try +{$ENDIF} //g_Game_Free(false); // don't free textures for the same map g_Game_ClearLoading(); g_Game_SetLoadingText(_lc[I_LOAD_SAVE_FILE], 0, False); @@ -405,10 +407,7 @@ begin // Çàãðóçêà è çàïóñê êàðòû //FIXME: save/load `asMegawad` if not g_Game_StartMap(false{asMegawad}, WAD_Path+':\'+Map_Name, True, curmapfile) then - begin - g_FatalError(Format(_lc[I_GAME_ERROR_MAP_LOAD], [WAD_Path + ':\' + Map_Name])); - exit; - end; + raise Exception.Create(Format(_lc[I_GAME_ERROR_MAP_LOAD], [WAD_Path + ':\' + Map_Name])); // Íàñòðîéêè èãðîêîâ è áîòîâ g_Player_Init(); @@ -488,14 +487,14 @@ begin // done gLoadGameMode := false; result := true; - {$IF DEFINED(D2F_DEBUG)} +{$IF DEFINED(D2F_DEBUG)} except begin errpos := LongWord(st.position); raise; end; end; - {$ENDIF} +{$ENDIF} finally st.Free(); end; -- 2.29.2