1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00

* now everything should be fine with attacking in battle

This commit is contained in:
mateuszb 2009-02-05 15:44:21 +00:00
parent 0070c93888
commit 72bc53a1b9

View File

@ -2221,7 +2221,18 @@ void CPlayerInterface::battleAttack(BattleAttack *ba)
if(ba->shot()) if(ba->shot())
battleInt->stackIsShooting(ba->stackAttacking,cb->battleGetPos(ba->bsa.stackAttacked)); battleInt->stackIsShooting(ba->stackAttacking,cb->battleGetPos(ba->bsa.stackAttacked));
else else
battleInt->stackAttacking( ba->stackAttacking, ba->counter() ? curAction->destinationTile : curAction->additionalInfo ); {
CStack * attacker = cb->battleGetStackByID(ba->stackAttacking);
int shift = 0;
if(ba->counter() && BattleInfo::mutualPosition(curAction->destinationTile, attacker->position) < 0)
{
if(attacker->attackerOwned)
shift = 1;
else
shift = -1;
}
battleInt->stackAttacking( ba->stackAttacking, ba->counter() ? curAction->destinationTile + shift : curAction->additionalInfo );
}
} }
void CPlayerInterface::showComp(SComponent comp) void CPlayerInterface::showComp(SComponent comp)
{ {