From a658b5121fdff908e50fee86753d3bd50ef4de81 Mon Sep 17 00:00:00 2001 From: Sevenfm Date: Wed, 4 May 2022 16:46:35 +0000 Subject: [PATCH] SIDE_FACING_DIVISOR: allow this option to work for crouched target, but with lowered divisor. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9377 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/LOS.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Tactical/LOS.cpp b/Tactical/LOS.cpp index bd5c6aec..e57cf6e4 100644 --- a/Tactical/LOS.cpp +++ b/Tactical/LOS.cpp @@ -9693,8 +9693,9 @@ void LimitImpactPointByFacing( SOLDIERTYPE *pShooter, SOLDIERTYPE *pTarget, FLOA // sevenfm: only allow this mechanics for standing human bodytype, as in other cases it may result in balance issues if(!pShooter || !pTarget || + gGameCTHConstants.SIDE_FACING_DIVISOR <= 1.0f || !IS_MERC_BODY_TYPE(pTarget) && !IS_CIV_BODY_TYPE(pTarget) || - gAnimControl[pTarget->usAnimState].ubEndHeight < ANIM_STAND || + gAnimControl[pTarget->usAnimState].ubEndHeight < ANIM_CROUCH || pShooter->bAimShotLocation == AIM_SHOT_HEAD) { return; @@ -9704,6 +9705,10 @@ void LimitImpactPointByFacing( SOLDIERTYPE *pShooter, SOLDIERTYPE *pTarget, FLOA UINT8 iTargetFacing = pTarget->ubDirection; FLOAT iDivisor = gGameCTHConstants.SIDE_FACING_DIVISOR; + // sevenfm: lower modifier for crouched + if (gAnimControl[pTarget->usAnimState].ubEndHeight == ANIM_CROUCH) + iDivisor = 1.0f + (iDivisor - 1.0f) / 2.0f; + switch (iTargetFacing) { case 0: