New option NEW_RANDOM (default TRUE) enables new code for random number generation.

Fixed PreRandom(1) bug in AddPlacementToWorld.
AddPossiblePendingEnemiesToBattle: use Random(4) instead of GetRndNum(3) for random insertion code.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8747 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2020-02-09 18:35:04 +00:00
parent 90db9fa346
commit 6005382920
6 changed files with 52 additions and 15 deletions
+6 -4
View File
@@ -680,9 +680,10 @@ BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *curr, GROUP *pGroup = NULL )
if (tempDetailedPlacement.ubProfile == NO_PROFILE)
{//dnl!!!
// these guys should be guarding Tony!
// sevenfm: PreRandom(1) always returns 0, use PreRandom(2) instead
tempDetailedPlacement.sInsertionGridNo = gModSettings.iPornShopEntranceGridNo +
(INT16) ( PreRandom( 8 ) * ( PreRandom( 1 ) ? -1 : 1)
+ PreRandom( 8 ) * ( PreRandom( 1 ) ? -1 : 1) * WORLD_ROWS );
//(INT16)(PreRandom(8) * (PreRandom(1) ? -1 : 1) + PreRandom(8) * (PreRandom(1) ? -1 : 1) * WORLD_ROWS);
(INT16)(PreRandom(8) * (PreRandom(2) ? -1 : 1) + PreRandom(8) * (PreRandom(2) ? -1 : 1) * WORLD_ROWS);
switch( PreRandom( 3 ) )
{
@@ -701,9 +702,10 @@ BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *curr, GROUP *pGroup = NULL )
else if (tempDetailedPlacement.ubProfile == BILLY )
{//dnl!!!
// billy should now be able to roam around
// sevenfm: PreRandom(1) always returns 0, use PreRandom(2) instead
tempDetailedPlacement.sInsertionGridNo = gModSettings.iPornShopEntranceGridNo +
(INT16) ( PreRandom( 30 ) * ( PreRandom( 1 ) ? -1 : 1)
+ PreRandom( 30 ) * ( PreRandom( 1 ) ? -1 : 1) * WORLD_ROWS );
//(INT16)(PreRandom(30) * (PreRandom(1) ? -1 : 1) + PreRandom(30) * (PreRandom(1) ? -1 : 1) * WORLD_ROWS);
(INT16)(PreRandom(30) * (PreRandom(2) ? -1 : 1) + PreRandom(30) * (PreRandom(2) ? -1 : 1) * WORLD_ROWS);
tempDetailedPlacement.bOrders = SEEKENEMY;
}
else if ( tempDetailedPlacement.ubProfile == MADAME )