From 1d1616707d5e224dd8febba4fac1c991e7e66d03 Mon Sep 17 00:00:00 2001 From: silversurfer Date: Mon, 16 Feb 2015 19:23:09 +0000 Subject: [PATCH] fix: Mercs were always complaining that they can't hit a target with buckshot. Problem was that only one pellet was considered for the fake shot. Now all are calculated and the best result is returned. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7741 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/LOS.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Tactical/LOS.cpp b/Tactical/LOS.cpp index 6767f4525..53061b1e9 100644 --- a/Tactical/LOS.cpp +++ b/Tactical/LOS.cpp @@ -4438,6 +4438,7 @@ INT8 FireBulletGivenTargetNCTH( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, UINT8 ubShots=0; UINT8 ubImpact=0; INT8 bCTGT = 0; + INT8 bTempCTGT = 0; UINT8 ubSpreadIndex = 0; UINT16 usBulletFlags = 0; int n=0; @@ -4858,7 +4859,13 @@ INT8 FireBulletGivenTargetNCTH( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, { bCTGT = FireBullet( pFirer->ubID, pBullet, TRUE ); RemoveBullet( iBullet ); - return( bCTGT ); + bTempCTGT = __max( bTempCTGT, bCTGT); + if ( ubLoop + 1 < ubShots && bTempCTGT < 100 ) + { + continue; + } + else + return( bTempCTGT ); } else {