Browse Source

* now everything should be fine with attacking in battle

mateuszb 16 years ago
parent
commit
72bc53a1b9
1 changed files with 12 additions and 1 deletions
  1. 12 1
      CPlayerInterface.cpp

+ 12 - 1
CPlayerInterface.cpp

@@ -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)
 {