mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
- bugfix: Wrong AP deduction if a merc punches the enemy
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@653 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -124,6 +124,9 @@ enum
|
||||
EX_DIRECTION_IRRELEVANT
|
||||
} ExtendedWorldDirections;
|
||||
|
||||
// WANNE
|
||||
BOOLEAN bPreDeductPunchAPs = FALSE;
|
||||
|
||||
// LUT for conversion from 8-direction to extended direction
|
||||
UINT8 ubExtDirection[] =
|
||||
{
|
||||
@@ -4836,23 +4839,27 @@ void EVENT_InternalSetSoldierDesiredDirection( SOLDIERTYPE *pSoldier, UINT16 usN
|
||||
|
||||
if ( pSoldier->bDesiredDirection != pSoldier->bDirection )
|
||||
{
|
||||
if ( gAnimControl[ usAnimState ].uiFlags & ( ANIM_BREATH | ANIM_OK_CHARGE_AP_FOR_TURN | ANIM_FIREREADY ) && !fInitalMove && !pSoldier->fDontChargeTurningAPs )
|
||||
// WANNE: If we punch the enemy, do not pre deduct the aps!
|
||||
if (bPreDeductPunchAPs == TRUE)
|
||||
{
|
||||
// Deduct points for initial turn!
|
||||
switch( gAnimControl[ usAnimState ].ubEndHeight )
|
||||
if ( gAnimControl[ usAnimState ].uiFlags & ( ANIM_BREATH | ANIM_OK_CHARGE_AP_FOR_TURN | ANIM_FIREREADY ) && !fInitalMove && !pSoldier->fDontChargeTurningAPs )
|
||||
{
|
||||
// Now change to appropriate animation
|
||||
case ANIM_STAND:
|
||||
DeductPoints( pSoldier, AP_LOOK_STANDING, 0 );
|
||||
break;
|
||||
// Deduct points for initial turn!
|
||||
switch( gAnimControl[ usAnimState ].ubEndHeight )
|
||||
{
|
||||
// Now change to appropriate animation
|
||||
case ANIM_STAND:
|
||||
DeductPoints( pSoldier, AP_LOOK_STANDING, 0 );
|
||||
break;
|
||||
|
||||
case ANIM_CROUCH:
|
||||
DeductPoints( pSoldier, AP_LOOK_CROUCHED, 0 );
|
||||
break;
|
||||
case ANIM_CROUCH:
|
||||
DeductPoints( pSoldier, AP_LOOK_CROUCHED, 0 );
|
||||
break;
|
||||
|
||||
case ANIM_PRONE:
|
||||
DeductPoints( pSoldier, AP_LOOK_PRONE, 0 );
|
||||
break;
|
||||
case ANIM_PRONE:
|
||||
DeductPoints( pSoldier, AP_LOOK_PRONE, 0 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8812,9 +8819,14 @@ void EVENT_SoldierBeginPunchAttack( SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8
|
||||
|
||||
if ( fChangeDirection )
|
||||
{
|
||||
// CHANGE DIRECTION AND GOTO ANIMATION NOW
|
||||
// WANNE: Do not pre deduct APs for punching. These APs are calculated later!
|
||||
bPreDeductPunchAPs = FALSE;
|
||||
|
||||
// CHANGE DIRECTION AND GOTO ANIMATION NOW
|
||||
EVENT_SetSoldierDesiredDirection( pSoldier, ubDirection );
|
||||
EVENT_SetSoldierDirection( pSoldier, ubDirection );
|
||||
|
||||
bPreDeductPunchAPs = TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user