mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
* now everything should be fine with attacking in battle
This commit is contained in:
parent
0070c93888
commit
72bc53a1b9
@ -2221,7 +2221,18 @@ void CPlayerInterface::battleAttack(BattleAttack *ba)
|
||||
if(ba->shot())
|
||||
battleInt->stackIsShooting(ba->stackAttacking,cb->battleGetPos(ba->bsa.stackAttacked));
|
||||
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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user