mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
- Bugfix: Sometimes save games generated by Assert have an invalid startup screen. Added a check to make sure the save game will at least go to the map screen on loading rather than stay on the main screen (by tazpn)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4672 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -7260,6 +7260,26 @@ BOOLEAN SaveGeneralInfo( HWFILE hFile )
|
|||||||
extern UINT32 guiRainLoop;
|
extern UINT32 guiRainLoop;
|
||||||
//end rain
|
//end rain
|
||||||
|
|
||||||
|
void EnsureValidLoadScreen( UINT32* puiScreen )
|
||||||
|
{
|
||||||
|
if (!puiScreen)
|
||||||
|
return;
|
||||||
|
|
||||||
|
switch(*puiScreen)
|
||||||
|
{
|
||||||
|
case GAME_SCREEN:
|
||||||
|
case MAP_SCREEN:
|
||||||
|
case LAPTOP_SCREEN:
|
||||||
|
// These are valid screens
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// By default go to the strategic map if not a valid screen otherwise
|
||||||
|
*puiScreen = MAP_SCREEN;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
BOOLEAN LoadGeneralInfo( HWFILE hFile )
|
BOOLEAN LoadGeneralInfo( HWFILE hFile )
|
||||||
{
|
{
|
||||||
//UINT32 uiNumBytesRead;
|
//UINT32 uiNumBytesRead;
|
||||||
@@ -7406,6 +7426,9 @@ BOOLEAN LoadGeneralInfo( HWFILE hFile )
|
|||||||
return( FALSE );
|
return( FALSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sometimes autosaves have invalid screens references esp. when generated on assert
|
||||||
|
EnsureValidLoadScreen(&sGeneralInfo.uiCurrentScreen);
|
||||||
|
|
||||||
gMusicModeToPlay = sGeneralInfo.ubMusicMode;
|
gMusicModeToPlay = sGeneralInfo.ubMusicMode;
|
||||||
|
|
||||||
guiCurrentUniqueSoldierId = sGeneralInfo.uiCurrentUniqueSoldierId;
|
guiCurrentUniqueSoldierId = sGeneralInfo.uiCurrentUniqueSoldierId;
|
||||||
|
|||||||
Reference in New Issue
Block a user