mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10: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:
@@ -3969,6 +3969,10 @@ INT8 DrawUIMovementPath( SOLDIERTYPE *pSoldier, UINT16 usMapPos, UINT32 uiFlags
|
||||
if ( sGotLocation != NOWHERE )
|
||||
{
|
||||
sAPCost += MinAPsToAttack( pSoldier, sAdjustedGridNo, TRUE );
|
||||
|
||||
// WANNE: Turn around APs were missing!
|
||||
//sAPCost += APsToTurnAround(pSoldier, sAdjustedGridNo);
|
||||
|
||||
sAPCost += UIPlotPath( pSoldier, sGotLocation, NO_COPYROUTE, fPlot, TEMPORARY, (UINT16)pSoldier->usUIMovementMode, NOT_STEALTH, FORWARD, pSoldier->bActionPoints);
|
||||
|
||||
if ( sGotLocation != pSoldier->sGridNo && fGotAdjacent )
|
||||
@@ -4083,6 +4087,39 @@ INT8 DrawUIMovementPath( SOLDIERTYPE *pSoldier, UINT16 usMapPos, UINT32 uiFlags
|
||||
return( bReturnCode );
|
||||
}
|
||||
|
||||
// WANNE: Calculate the APs to turn around
|
||||
INT16 APsToTurnAround(SOLDIERTYPE *pSoldier, INT16 sAdjustedGridNo)
|
||||
{
|
||||
INT16 sAPCost = 0;
|
||||
BOOLEAN fInitalMove = FALSE;
|
||||
|
||||
// Get the new direction
|
||||
UINT8 ubDirection = (UINT8)GetDirectionFromGridNo( sAdjustedGridNo, pSoldier );
|
||||
|
||||
// If new direction is not the same than the old direction
|
||||
if ( pSoldier->bDesiredDirection != ubDirection)
|
||||
{
|
||||
if ( gAnimControl[ pSoldier->usAnimState ].uiFlags & ( ANIM_BREATH | ANIM_OK_CHARGE_AP_FOR_TURN | ANIM_FIREREADY ) && !fInitalMove && !pSoldier->fDontChargeTurningAPs )
|
||||
{
|
||||
// Which position has the soldier?
|
||||
switch( gAnimControl[ pSoldier->usAnimState ].ubEndHeight )
|
||||
{
|
||||
case ANIM_STAND:
|
||||
sAPCost += AP_LOOK_STANDING;
|
||||
break;
|
||||
case ANIM_CROUCH:
|
||||
sAPCost += AP_LOOK_CROUCHED;
|
||||
break;
|
||||
case ANIM_PRONE:
|
||||
sAPCost += AP_LOOK_PRONE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return sAPCost;
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN UIMouseOnValidAttackLocation( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user