diff --git a/src/include/unit_find.h b/src/include/unit_find.h index b3ff1614a6..b3bd15ab81 100644 --- a/src/include/unit_find.h +++ b/src/include/unit_find.h @@ -237,7 +237,7 @@ void SelectFixed(const Vec2i <Pos, const Vec2i &rbPos, std::vector &u Assert(Map.Info.IsPointOnMap(rbPos)); Assert(units.empty()); units.reserve(selectMax << 1); - int max = selectMax | INT_MAX; + int max = selectMax ? selectMax : INT_MAX; for (Vec2i posIt = ltPos; posIt.y != rbPos.y + 1; ++posIt.y) { for (posIt.x = ltPos.x; posIt.x != rbPos.x + 1; ++posIt.x) {