mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
* hopefully fixed 152
This commit is contained in:
@@ -3668,10 +3668,12 @@ si8 BattleInfo::hasDistancePenalty( int stackID, int destHex )
|
|||||||
{
|
{
|
||||||
const CStack * stack = getStack(stackID);
|
const CStack * stack = getStack(stackID);
|
||||||
|
|
||||||
int distance = std::abs(destHex % BFIELD_WIDTH - stack->position % BFIELD_WIDTH);
|
int xDst = std::abs(destHex % BFIELD_WIDTH - stack->position % BFIELD_WIDTH),
|
||||||
|
yDst = std::abs(destHex / BFIELD_WIDTH - stack->position / BFIELD_WIDTH);
|
||||||
|
int distance = std::max(xDst, yDst) + std::min(xDst, yDst) - (std::max(xDst, yDst) + 1)/2;
|
||||||
|
|
||||||
//I hope it's approximately correct
|
//I hope it's approximately correct
|
||||||
return distance > 8 && !stack->hasBonusOfType(Bonus::NO_DISTANCE_PENALTY);
|
return distance > 10 && !stack->hasBonusOfType(Bonus::NO_DISTANCE_PENALTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
si8 BattleInfo::sameSideOfWall(int pos1, int pos2)
|
si8 BattleInfo::sameSideOfWall(int pos1, int pos2)
|
||||||
|
Reference in New Issue
Block a user