From 9b566f502cf68f04d19fea64b720eae323777bc9 Mon Sep 17 00:00:00 2001 From: ChrisL Date: Tue, 6 Sep 2011 21:19:52 +0000 Subject: [PATCH] Fixed a NCTH bug where a negative PercentCap would not calculate properly because the uiCap variable it applies to could not support signed results. Fixed a NCTH bug where a negative PercentTargetTrackingSpeed would not calculate properly because the uiTilesForMaxPenalty variable it applies to could not support signed results. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4637 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/LOS.cpp | 2 +- Tactical/Weapons.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tactical/LOS.cpp b/Tactical/LOS.cpp index 12ca0322..c1033f6c 100644 --- a/Tactical/LOS.cpp +++ b/Tactical/LOS.cpp @@ -7051,7 +7051,7 @@ void CalcTargetMovementOffset( SOLDIERTYPE *pShooter, SOLDIERTYPE *pTarget, OBJE // Add a percentage-based modifier from the weapon and its attachments. Movement tracking devices will // provide faster compensation for target movement, allowing the shooter to begin adjusting the muzzle // after the target moves a smaller number of tiles. - uiTilesForMaxPenalty += (uiTilesForMaxPenalty * GetTargetTrackingModifier( pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight )) / 100; + uiTilesForMaxPenalty += (INT16)(uiTilesForMaxPenalty * GetTargetTrackingModifier( pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight )) / 100; if (uiTilesForMaxPenalty == 0) { diff --git a/Tactical/Weapons.cpp b/Tactical/Weapons.cpp index 5813f10c..0acfbbb2 100644 --- a/Tactical/Weapons.cpp +++ b/Tactical/Weapons.cpp @@ -5327,7 +5327,7 @@ UINT32 CalcNewChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi UINT32 uiCap = (UINT32)iCombinedSkill; // Add percent-based modifier from the gun and its attachments - uiCap += (uiCap * GetPercentCapModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100; + uiCap += (INT32)(uiCap * GetPercentCapModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100; // Add bonuses from Sniper Skill. Applies only when using a scope at or above its "best" range. INT16 sDifference = 99 - uiCap;