mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Removed assertion in Random.cpp
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2648 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -33,7 +33,11 @@ UINT32 Random(UINT32 uiRange)
|
||||
|
||||
BOOLEAN Chance( UINT32 uiChance )
|
||||
{
|
||||
AssertLE(uiChance, 100);
|
||||
//AssertLE(uiChance, 100);
|
||||
// lalien: since uiChance calculation is based on different values it can happen that uiChance is > than 100%
|
||||
// It's not critical because uiChance >= 100 will always return TRUE. No need to crash the entire game.
|
||||
// Make sure that uiChance value is not < than 0, or it can switch to positive
|
||||
|
||||
return (BOOLEAN)(Random( 100 ) < uiChance);
|
||||
}
|
||||
|
||||
@@ -71,6 +75,10 @@ UINT32 PreRandom( UINT32 uiRange )
|
||||
|
||||
BOOLEAN PreChance( UINT32 uiChance )
|
||||
{
|
||||
AssertLE(uiChance, 100);
|
||||
//AssertLE(uiChance, 100);
|
||||
// lalien: since uiChance calculation is based on different values it can happen that uiChance is > than 100%
|
||||
// It's not critical because uiChance >= 100 will always return TRUE. No need to crash the entire game.
|
||||
// Make sure that uiChance value is not < than 0, or it can switch to positive
|
||||
|
||||
return (BOOLEAN)(PreRandom( 100 ) < uiChance);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user