1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-23 00:28:08 +02:00

- Added missing abilities for devil & ghost dragon

- Stack affected by Berserk should not try to attack itself

Neither of these can be actually seen in game duo to more general engine bugs :/
This commit is contained in:
DjWarmonger
2013-04-27 06:39:59 +00:00
parent 0f7d175896
commit 32c87f532f
6 changed files with 22 additions and 9 deletions

View File

@ -1175,7 +1175,7 @@ std::set<BattleHex> CBattleInfoCallback::getStoppers(BattlePerspective::BattlePe
return ret;
}
std::pair<const CStack *, BattleHex> CBattleInfoCallback::getNearestStack(const CStack * closest, boost::logic::tribool attackerOwned) const
std::pair<const CStack *, BattleHex> CBattleInfoCallback::getNearestStack(const CStack * closest, boost::logic::tribool attackerOwned, bool ignoreItself) const
{
auto reachability = getReachability(closest);
@ -1190,6 +1190,8 @@ std::pair<const CStack *, BattleHex> CBattleInfoCallback::getNearestStack(const
for(int g=0; g<GameConstants::BFIELD_SIZE; ++g)
{
const CStack * atG = battleGetStackByPos(g);
if (ignoreItself && atG == closest) //don't attack itself in berserk
continue;
if(!atG || atG->ID == closest->ID) //if there is not stack or we are the closest one
continue;