- 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:
Wanne
2012-05-15 21:07:53 +00:00
parent 64eb3caf9f
commit c4f005d7e7
2 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -7352,7 +7352,7 @@ void CalcTargetMovementOffset( SOLDIERTYPE *pShooter, SOLDIERTYPE *pTarget, OBJE
// Again, if the shooter is skilled, this will occur after fewer tiles have been moved.
// If the target moves *more* tiles than this, the movement penalty will begin to diminish. That's our shooter
// beginning to compensate for the target's speed, pointing the gun ahead of the target ("Leading the target").
UINT8 uiTilesForMaxPenalty = (100-uiCombinedSkill) / (100 / gGameCTHConstants.MOVEMENT_TRACKING_DIFFICULTY);
INT16 uiTilesForMaxPenalty = (INT16)((100-uiCombinedSkill) / (100 / gGameCTHConstants.MOVEMENT_TRACKING_DIFFICULTY));
UINT8 stance = gAnimControl[ pShooter->usAnimState ].ubEndHeight;
@@ -7365,7 +7365,7 @@ void CalcTargetMovementOffset( SOLDIERTYPE *pShooter, SOLDIERTYPE *pTarget, OBJE
// after the target moves a smaller number of tiles.
INT32 moda = (INT32)(uiTilesForMaxPenalty * GetTargetTrackingModifier( pWeapon, stance )) / 100;
INT32 modb = (INT32)(uiTilesForMaxPenalty * GetTargetTrackingModifier( pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight )) / 100;
uiTilesForMaxPenalty += (UINT8)((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
uiTilesForMaxPenalty += (INT16)((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
if (uiTilesForMaxPenalty == 0)
{
+5 -5
View File
@@ -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