mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
Change to use vector for pre-RNG array
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2792 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+20
-4
@@ -6409,11 +6409,19 @@ BOOLEAN SavePreRandomNumbersToSaveGameFile( HWFILE hFile )
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Save the Prerandom number index
|
//Save the Prerandom number index
|
||||||
FileWrite( hFile, guiPreRandomNums, sizeof( UINT32 ) * MAX_PREGENERATED_NUMS, &uiNumBytesWritten );
|
for (std::vector<UINT32>::iterator iter = guiPreRandomNums.begin();
|
||||||
if( uiNumBytesWritten != sizeof( UINT32 ) * MAX_PREGENERATED_NUMS )
|
iter != guiPreRandomNums.end(); ++iter) {
|
||||||
|
FileWrite( hFile, &*iter, sizeof( UINT32 ), &uiNumBytesWritten );
|
||||||
|
if( uiNumBytesWritten != sizeof( UINT32 ) )
|
||||||
{
|
{
|
||||||
return( FALSE );
|
return( FALSE );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
//FileWrite( hFile, guiPreRandomNums, sizeof( UINT32 ) * MAX_PREGENERATED_NUMS, &uiNumBytesWritten );
|
||||||
|
//if( uiNumBytesWritten != sizeof( UINT32 ) * MAX_PREGENERATED_NUMS )
|
||||||
|
//{
|
||||||
|
// return( FALSE );
|
||||||
|
//}
|
||||||
|
|
||||||
return( TRUE );
|
return( TRUE );
|
||||||
}
|
}
|
||||||
@@ -6430,11 +6438,19 @@ BOOLEAN LoadPreRandomNumbersFromSaveGameFile( HWFILE hFile )
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Load the Prerandom number index
|
//Load the Prerandom number index
|
||||||
FileRead( hFile, guiPreRandomNums, sizeof( UINT32 ) * MAX_PREGENERATED_NUMS, &uiNumBytesRead );
|
for (std::vector<UINT32>::iterator iter = guiPreRandomNums.begin();
|
||||||
if( uiNumBytesRead != sizeof( UINT32 ) * MAX_PREGENERATED_NUMS )
|
iter != guiPreRandomNums.end(); ++iter) {
|
||||||
|
FileRead( hFile, &*iter, sizeof( UINT32 ), &uiNumBytesRead );
|
||||||
|
if( uiNumBytesRead != sizeof( UINT32 ) )
|
||||||
{
|
{
|
||||||
return( FALSE );
|
return( FALSE );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// FileRead( hFile, guiPreRandomNums, sizeof( UINT32 ) * MAX_PREGENERATED_NUMS, &uiNumBytesRead );
|
||||||
|
// if( uiNumBytesRead != sizeof( UINT32 ) * MAX_PREGENERATED_NUMS )
|
||||||
|
// {
|
||||||
|
// return( FALSE );
|
||||||
|
// }
|
||||||
|
|
||||||
return( TRUE );
|
return( TRUE );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user