Improved code to update scope mode when changing stance.

ChangeScopeMode: use NOWHERE instead of 0 as incorrect target gridno.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8796 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2020-04-30 00:48:52 +00:00
parent b729583bcb
commit 7f8fc44a7d
4 changed files with 18 additions and 6 deletions
+15 -3
View File
@@ -3828,14 +3828,21 @@ void UIHandleSoldierStanceChange( UINT8 ubSoldierID, INT8 bNewStance )
pSoldier->bGoodContPath = FALSE;
//dnl ch71 180913 when we go to crouch or prone for now there is no alternative fire mode option
if(pSoldier->bScopeMode == USE_ALT_WEAPON_HOLD && bNewStance != ANIM_STAND)
if (pSoldier->bScopeMode == USE_ALT_WEAPON_HOLD && bNewStance != ANIM_STAND ||
gGameExternalOptions.ubAllowAlternativeWeaponHolding &&
pSoldier->inv[HANDPOS].exists() &&
Weapon[pSoldier->inv[HANDPOS].usItem].HeavyGun &&
Item[pSoldier->inv[HANDPOS].usItem].twohanded &&
bNewStance == ANIM_STAND)
{
ChangeScopeMode(pSoldier, 0);
ChangeScopeMode(pSoldier, NOWHERE);
ManLooksForOtherTeams(pSoldier);
}
}
else
{
return;
}
}
// If realtime- change walking animation!
@@ -3872,7 +3879,12 @@ void UIHandleSoldierStanceChange( UINT8 ubSoldierID, INT8 bNewStance )
}
// sevenfm: switch from alt weapon holding when changing stance in realtime
if (pSoldier->bScopeMode == USE_ALT_WEAPON_HOLD && bNewStance != ANIM_STAND)
if (pSoldier->bScopeMode == USE_ALT_WEAPON_HOLD && bNewStance != ANIM_STAND ||
gGameExternalOptions.ubAllowAlternativeWeaponHolding &&
pSoldier->inv[HANDPOS].exists() &&
Weapon[pSoldier->inv[HANDPOS].usItem].HeavyGun &&
Item[pSoldier->inv[HANDPOS].usItem].twohanded &&
bNewStance == ANIM_STAND)
{
ChangeScopeMode(pSoldier, NOWHERE);
ManLooksForOtherTeams(pSoldier);