mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
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
This commit is contained in:
@@ -2981,30 +2981,43 @@ BOOLEAN LoadEncyclopediaFromLoadGameFile( HWFILE hFile )
|
|||||||
|
|
||||||
#ifdef ENABLE_BRIEFINGROOM
|
#ifdef ENABLE_BRIEFINGROOM
|
||||||
|
|
||||||
|
// Flugente: compatibility fix
|
||||||
|
BOOLEAN briefingroomreadingdone = FALSE;
|
||||||
|
|
||||||
//Briefing room
|
//Briefing room
|
||||||
FileRead( hFile, &saveBriefingRoomData, sizeof( saveBriefingRoomData), &uiNumBytesRead );
|
FileRead( hFile, &saveBriefingRoomData, sizeof( saveBriefingRoomData), &uiNumBytesRead );
|
||||||
if( uiNumBytesRead != sizeof( saveBriefingRoomData ) )
|
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<NUM_SECTOR; i++)
|
if ( !briefingroomreadingdone )
|
||||||
{
|
{
|
||||||
gBriefingRoomData[ i ].Hidden = saveBriefingRoomData[i].Hidden;
|
for(i=0; i<NUM_SECTOR; i++)
|
||||||
gBriefingRoomData[ i ].CheckMission = saveBriefingRoomData[i].CheckMission;
|
{
|
||||||
}
|
gBriefingRoomData[ i ].Hidden = saveBriefingRoomData[i].Hidden;
|
||||||
|
gBriefingRoomData[ i ].CheckMission = saveBriefingRoomData[i].CheckMission;
|
||||||
|
}
|
||||||
|
|
||||||
//Briefing room , special mission
|
//Briefing room , special mission
|
||||||
FileRead( hFile, &saveBriefingRoomSpecialMissionData, sizeof( saveBriefingRoomSpecialMissionData), &uiNumBytesRead );
|
FileRead( hFile, &saveBriefingRoomSpecialMissionData, sizeof( saveBriefingRoomSpecialMissionData), &uiNumBytesRead );
|
||||||
if( uiNumBytesRead != sizeof( saveBriefingRoomSpecialMissionData ) )
|
if( uiNumBytesRead != sizeof( saveBriefingRoomSpecialMissionData ) )
|
||||||
{
|
{
|
||||||
return( FALSE );
|
return( FALSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i=0; i<NUM_SECTOR; i++)
|
for(i=0; i<NUM_SECTOR; i++)
|
||||||
{
|
{
|
||||||
gBriefingRoomSpecialMissionData[ i ].Hidden = saveBriefingRoomSpecialMissionData[i].Hidden;
|
gBriefingRoomSpecialMissionData[ i ].Hidden = saveBriefingRoomSpecialMissionData[i].Hidden;
|
||||||
gBriefingRoomSpecialMissionData[ i ].CheckMission = saveBriefingRoomSpecialMissionData[i].CheckMission;
|
gBriefingRoomSpecialMissionData[ i ].CheckMission = saveBriefingRoomSpecialMissionData[i].CheckMission;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user