1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

All multi-hex attacks and shots should now be fully functional.

This commit is contained in:
DjWarmonger
2011-07-05 06:07:36 +00:00
parent e95ae22061
commit 08b7d0db17
3 changed files with 14 additions and 14 deletions

View File

@ -785,15 +785,15 @@ std::set<CStack*> BattleInfo::getAttackedCreatures(const CStack* attacker, THex
std::vector<THex> hexes;
if (attacker->attackerOwned)
{
THex::checkAndPush(hex - ( (hex/WN)%2 ? WN+1 : WN ), hexes);
THex::checkAndPush(hex - ( (hex/WN)%2 ? WN+1 : WN ), hexes); //upper
THex::checkAndPush(hex + 1, hexes);
THex::checkAndPush(hex + ( (hex/WN)%2 ? WN : WN+1 ), hexes);
THex::checkAndPush(hex + ( (hex/WN)%2 ? WN : WN+1 ), hexes); //lower
}
else
{
THex::checkAndPush(hex - ( (hex/WN)%2 ? WN : WN-1 ), hexes);
THex::checkAndPush(hex - ( (hex/WN)%2 ? WN+1 : WN ), hexes);
THex::checkAndPush(hex - 1, hexes);
THex::checkAndPush(hex - ( (hex/WN)%2 ? WN-1 : WN ), hexes);
THex::checkAndPush(hex + ( (hex/WN)%2 ? WN-1 : WN ), hexes);
}
BOOST_FOREACH (THex tile, hexes)
{