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
This commit is contained in:
Sevenfm
2022-05-04 16:46:35 +00:00
parent 2cdc346934
commit a658b5121f
+6 -1
View File
@@ -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: