mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user