1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-10 22:31:40 +02:00

Consider units on wall hexes as 'inside' town for tower target selection

This commit is contained in:
Ivan Savenko
2025-01-26 15:51:54 +00:00
parent 112de6324f
commit abc7168ff6
2 changed files with 7 additions and 1 deletions

View File

@@ -267,6 +267,12 @@ public:
return hex < other.hex; return hex < other.hex;
} }
[[nodiscard]] bool operator <=(const BattleHex & other) const noexcept
{
return hex <= other.hex;
}
template <typename Handler> template <typename Handler>
void serialize(Handler & h) void serialize(Handler & h)
{ {

View File

@@ -51,7 +51,7 @@ static bool sameSideOfWall(const BattleHex & pos1, const BattleHex & pos2)
static bool isInsideWalls(const BattleHex & pos) static bool isInsideWalls(const BattleHex & pos)
{ {
return lineToWallHex(pos.getY()) < pos; return lineToWallHex(pos.getY()) <= pos;
} }
// parts of wall // parts of wall