NCTH CalcNewChanceToHitGun refactoring / cleanup (by silversurfer)

o Externalized ja2_options.ini value if you want to use / or not the cleaned up version of CalcNewChanceToHitGun: USE_NEW_CTH_CALCULATION
o The cleanup only effects the game if you play with NCTH system
o The refactoring makes the code much easier to read and also shrinks the locs
o Fixed some old bugs in calculation
o In the future the switch USE_NEW_CTH_CALCULATION can be removed completely
o more infos: http://www.ja-galaxy-forum.com/board/ubbthreads.php/topics/322986/Re_Potential_NCTH_Code_Change_.html#Post322986


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6235 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2013-07-21 17:08:42 +00:00
parent 502f5f6b77
commit 1b7c69dd0e
4 changed files with 953 additions and 8 deletions
+5
View File
@@ -12801,6 +12801,11 @@ FLOAT GetScopeRangeMultiplier( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObj, FLOAT d2
FLOAT rangeModifier = gGameCTHConstants.SCOPE_RANGE_MULTIPLIER;
iScopeFactor = GetScopeMagnificationFactor( pSoldier, pObj, d2DDistance );
// if we are not using a scope we will not apply "SCOPE_RANGE_MULTIPLIER"
if ( iScopeFactor <= 1.0 )
rangeModifier = 1.0;
if( gGameOptions.fNewTraitSystem )
{
if(iScopeFactor > 5.0f)