mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
- Fixed a bug that caused the PercentCapModifier and the TilesMaxPenalty to get bogus values (by Flugente & cnagorneac )
o This bug was re-added when HAM5 was integrated ... o see here: http://www.bears-pit.com/board/ubbthreads.php/topics/304750.html#Post304750 git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5274 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -5529,11 +5529,11 @@ UINT32 CalcNewChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
|
||||
|
||||
iCombinedSkill /= (gGameCTHConstants.AIM_EXP + gGameCTHConstants.AIM_MARKS + gGameCTHConstants.AIM_WIS + gGameCTHConstants.AIM_DEX);
|
||||
|
||||
UINT32 uiCap = (UINT32)iCombinedSkill;
|
||||
INT32 uiCap = (INT32)iCombinedSkill;
|
||||
// Add percent-based modifier from the gun and its attachments
|
||||
UINT32 uimoda = (UINT32)(uiCap * GetPercentCapModifier( pInHand, stance )) / 100;
|
||||
UINT32 uimodb = (UINT32)(uiCap * GetPercentCapModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100;
|
||||
uiCap += (UINT32)((gGameExternalOptions.ubProneModifierPercentage * uimoda + (100 - gGameExternalOptions.ubProneModifierPercentage) * uimodb)/100);
|
||||
INT32 uimoda = (INT32)(uiCap * GetPercentCapModifier( pInHand, stance )) / 100;
|
||||
INT32 uimodb = (INT32)(uiCap * GetPercentCapModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100;
|
||||
uiCap += (INT32)((gGameExternalOptions.ubProneModifierPercentage * uimoda + (100 - gGameExternalOptions.ubProneModifierPercentage) * uimodb)/100);
|
||||
|
||||
// Add bonuses from Sniper Skill. Applies only when using a scope at or above its "best" range.
|
||||
INT16 sDifference = 99 - uiCap;
|
||||
@@ -5578,7 +5578,7 @@ UINT32 CalcNewChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
|
||||
// cover when applying the maximum number of aiming clicks for this gun.
|
||||
INT32 iMaxAimBonus = uiCap - iChance;
|
||||
|
||||
iMaxAimBonus = (UINT32)((iMaxAimBonus * (100+iAimModifier)) / 100);
|
||||
iMaxAimBonus = (INT32)((iMaxAimBonus * (100+iAimModifier)) / 100);
|
||||
iMaxAimBonus = __max(0, iMaxAimBonus); // can't get less than 0 points for aiming...
|
||||
|
||||
// factor in scopes under their range
|
||||
|
||||
Reference in New Issue
Block a user