mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Merged New Inventory Project into main branch
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1871 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -22,9 +22,9 @@
|
||||
|
||||
void InitializeRandom()
|
||||
{
|
||||
// Seed the random-number generator with current time so that
|
||||
// the numbers will be different every time we run.
|
||||
srand( (unsigned) time(NULL) );
|
||||
// Seed the random-number generator with current time so that
|
||||
// the numbers will be different every time we run.
|
||||
srand( (unsigned) time(NULL) );
|
||||
#ifdef PRERANDOM_GENERATOR
|
||||
//Pregenerate all of the random numbers.
|
||||
for( guiPreRandomIndex = 0; guiPreRandomIndex < MAX_PREGENERATED_NUMS; guiPreRandomIndex++ )
|
||||
@@ -46,7 +46,7 @@ UINT32 Random(UINT32 uiRange)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (uiRange == 0)
|
||||
if (uiRange == 0)
|
||||
return(0);
|
||||
return rand() * uiRange / RAND_MAX % uiRange;
|
||||
}
|
||||
@@ -73,7 +73,7 @@ UINT32 PreRandom( UINT32 uiRange )
|
||||
uiNum = guiPreRandomNums[ guiPreRandomIndex ] * uiRange / RAND_MAX % uiRange;
|
||||
//Replace the current pregenerated number with a new one.
|
||||
|
||||
//This was removed in the name of optimization. Uncomment if you hate recycling.
|
||||
//This was removed in the name of optimization. Uncomment if you hate recycling.
|
||||
//guiPreRandomNums[ guiPreRandomIndex ] = rand();
|
||||
|
||||
//Go to the next index.
|
||||
|
||||
Reference in New Issue
Block a user