SpaceViking's random number and CTH adjustments.

OIV Graphic alignment correction.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2242 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
ChrisL
2008-07-17 00:16:16 +00:00
parent ad96055687
commit ec87dd51e6
3 changed files with 32 additions and 5 deletions
+14 -1
View File
@@ -78,8 +78,21 @@ UINT32 PreRandom( UINT32 uiRange )
//Go to the next index.
guiPreRandomIndex++;
if( guiPreRandomIndex >= (UINT32)MAX_PREGENERATED_NUMS )
//if( guiPreRandomIndex >= (UINT32)MAX_PREGENERATED_NUMS )
// guiPreRandomIndex = 0;
// WDS 07/06/2008 fix prerandom
if (guiPreRandomIndex == MAX_PREGENERATED_NUMS / 2) {
// [0..(MAX_PREGENERATED_NUMS/2) -1]
for( unsigned idx = 0; idx < MAX_PREGENERATED_NUMS / 2; ++idx ) {
guiPreRandomNums[ idx ] = rand();
}
} else if (guiPreRandomIndex >= (UINT32)MAX_PREGENERATED_NUMS ) {
// MAX_PREGENERATED_NUMS/2 .. MAX_PREGENERATED_NUMS-1]
for( unsigned idx = MAX_PREGENERATED_NUMS / 2; idx < MAX_PREGENERATED_NUMS; ++idx ) {
guiPreRandomNums[ idx ] = rand();
}
guiPreRandomIndex = 0;
}
return uiNum;
}