mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
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:
+15
-3
@@ -3828,14 +3828,21 @@ void UIHandleSoldierStanceChange( UINT8 ubSoldierID, INT8 bNewStance )
|
|||||||
pSoldier->bGoodContPath = FALSE;
|
pSoldier->bGoodContPath = FALSE;
|
||||||
|
|
||||||
//dnl ch71 180913 when we go to crouch or prone for now there is no alternative fire mode option
|
//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);
|
ManLooksForOtherTeams(pSoldier);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If realtime- change walking animation!
|
// 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
|
// 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);
|
ChangeScopeMode(pSoldier, NOWHERE);
|
||||||
ManLooksForOtherTeams(pSoldier);
|
ManLooksForOtherTeams(pSoldier);
|
||||||
|
|||||||
@@ -6519,7 +6519,7 @@ void ItemDescAttachmentsCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
// Flugente: if we altered a gun's attachments, re-evaluate the scope mode and sight
|
// Flugente: if we altered a gun's attachments, re-evaluate the scope mode and sight
|
||||||
if ( gGameExternalOptions.fScopeModes && gpItemPointerSoldier && Item[gpItemDescObject->usItem].usItemClass == IC_GUN )
|
if ( gGameExternalOptions.fScopeModes && gpItemPointerSoldier && Item[gpItemDescObject->usItem].usItemClass == IC_GUN )
|
||||||
{
|
{
|
||||||
ChangeScopeMode( gpItemPointerSoldier, 0 );
|
ChangeScopeMode(gpItemPointerSoldier, NOWHERE);
|
||||||
|
|
||||||
// reevaluate sight
|
// reevaluate sight
|
||||||
ManLooksForOtherTeams( gpItemPointerSoldier );
|
ManLooksForOtherTeams( gpItemPointerSoldier );
|
||||||
|
|||||||
@@ -5160,7 +5160,7 @@ void SetScopeMode( INT32 usMapPos )
|
|||||||
if ( GetMouseMapPos( &usMapPos ))
|
if ( GetMouseMapPos( &usMapPos ))
|
||||||
ChangeScopeMode( MercPtrs[ gusSelectedSoldier ], usMapPos );
|
ChangeScopeMode( MercPtrs[ gusSelectedSoldier ], usMapPos );
|
||||||
else
|
else
|
||||||
ChangeScopeMode( MercPtrs[ gusSelectedSoldier ], 0 );
|
ChangeScopeMode( MercPtrs[ gusSelectedSoldier ], NOWHERE );
|
||||||
|
|
||||||
// reevaluate sight
|
// reevaluate sight
|
||||||
ManLooksForOtherTeams( MercPtrs[ gusSelectedSoldier ] );
|
ManLooksForOtherTeams( MercPtrs[ gusSelectedSoldier ] );
|
||||||
|
|||||||
@@ -10269,7 +10269,7 @@ void ChangeScopeMode( SOLDIERTYPE * pSoldier, INT32 iTrgGridNo )
|
|||||||
// changing scope mode can change number of aiming levels, we should reset the aiming variable here
|
// changing scope mode can change number of aiming levels, we should reset the aiming variable here
|
||||||
// for the luxury of the payer, I've made it so if he had aiming set to a higher value, we give him the maximum value for the new scope mode,
|
// for the luxury of the payer, I've made it so if he had aiming set to a higher value, we give him the maximum value for the new scope mode,
|
||||||
// assuming he wants to go for the most accurate shot
|
// assuming he wants to go for the most accurate shot
|
||||||
if ( iTrgGridNo != 0 )
|
if ( iTrgGridNo != NOWHERE )
|
||||||
{
|
{
|
||||||
if ( bOldAimTime > AllowedAimingLevels(pSoldier, iTrgGridNo) )
|
if ( bOldAimTime > AllowedAimingLevels(pSoldier, iTrgGridNo) )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user