mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Fix: usBackGround is now UINT16 (was UINT8) to accommodate more than 255 backgrounds.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6513 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+13
-3
@@ -1496,9 +1496,19 @@ BOOLEAN MERCPROFILESTRUCT::Load(HWFILE hFile, bool forceLoadOldVersion, bool for
|
||||
// Flugente: backgrounds
|
||||
if(guiCurrentSaveGameVersion >= BACKGROUNDS)
|
||||
{
|
||||
if ( !FileRead( hFile, &this->usBackground, sizeof(UINT8), &uiNumBytesRead ) )
|
||||
if(guiCurrentSaveGameVersion >= BACKGROUNDS_FIX_UINT8)
|
||||
{
|
||||
return(FALSE);
|
||||
if ( !FileRead( hFile, &this->usBackground, sizeof(UINT16), &uiNumBytesRead ) )
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !FileRead( hFile, &this->usBackground, sizeof(UINT8), &uiNumBytesRead ) )
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1581,7 +1591,7 @@ BOOLEAN MERCPROFILESTRUCT::Save(HWFILE hFile)
|
||||
}
|
||||
|
||||
// Flugente: background
|
||||
if ( !FileWrite( hFile, &this->usBackground, sizeof(UINT8), &uiNumBytesWritten ) )
|
||||
if ( !FileWrite( hFile, &this->usBackground, sizeof(UINT16), &uiNumBytesWritten ) )
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user