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:
lalien
2009-03-31 12:15:33 +00:00
parent 5a232eb15f
commit 5f9261273a
+10 -2
View File
@@ -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);
}