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:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user