From 3b4d32be400cbbbd3c5675d36e469e4353692403 Mon Sep 17 00:00:00 2001 From: Flugente Date: Sun, 7 Jul 2013 11:10:12 +0000 Subject: [PATCH] Fix: loading a savegame that was started with an exe without ENABLE_BRIEFINGROOM was impossible with an exe with ENABLE_BRIEFINGROOM enabled. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6202 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Laptop/Encyclopedia_Data.cpp | 43 +++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/Laptop/Encyclopedia_Data.cpp b/Laptop/Encyclopedia_Data.cpp index cd4f0e98..21072447 100644 --- a/Laptop/Encyclopedia_Data.cpp +++ b/Laptop/Encyclopedia_Data.cpp @@ -2981,30 +2981,43 @@ BOOLEAN LoadEncyclopediaFromLoadGameFile( HWFILE hFile ) #ifdef ENABLE_BRIEFINGROOM + // Flugente: compatibility fix + BOOLEAN briefingroomreadingdone = FALSE; + //Briefing room FileRead( hFile, &saveBriefingRoomData, sizeof( saveBriefingRoomData), &uiNumBytesRead ); if( uiNumBytesRead != sizeof( saveBriefingRoomData ) ) { - return( FALSE ); + // Flugente: one can start a game without this feature and later switch to an exe where it is enabled. At that point, loading the savgame would not be possible - + // the game expects saveBriefingRoomData but doesn't get any. Pretty odd, considering that the data has ALREADY BEEN READ into gBriefingRoomData at this point. Sigh. + // For this reason, we don't return with an error here an simply use what the xml gave us here. + // Of course, I'm not familiar with this feature. It would be good if someone who knows this fixes this. + if ( uiNumBytesRead == 0 ) + briefingroomreadingdone = TRUE; + else + return( FALSE ); } - for(i=0; i