Fix map-region filter limits on the z-Axis based on minY instead of minZ

This commit is contained in:
Lukas Rieger (Blue) 2022-08-17 22:38:07 +02:00
parent 9e6cdc75de
commit 89ca7053dd
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2
2 changed files with 4 additions and 4 deletions

View File

@ -110,11 +110,11 @@ private static List<Vector2i> getRegions(BmMap map, Vector2i center, int radius)
Predicate<Vector2i> regionFilter = r -> {
Vector2i cellMin = regionGrid.getCellMin(r);
if (cellMin.getX() > map.getMapSettings().getMaxPos().getX()) return false;
if (cellMin.getY() > map.getMapSettings().getMaxPos().getY()) return false;
if (cellMin.getY() > map.getMapSettings().getMaxPos().getZ()) return false;
Vector2i cellMax = regionGrid.getCellMax(r);
if (cellMax.getX() < map.getMapSettings().getMinPos().getX()) return false;
return cellMax.getY() >= map.getMapSettings().getMinPos().getY();
return cellMax.getY() >= map.getMapSettings().getMinPos().getZ();
};
if (center == null || radius < 0) {

View File

@ -96,11 +96,11 @@ private synchronized void init() {
Predicate<Vector2i> boundsTileFilter = t -> {
Vector2i cellMin = tileGrid.getCellMin(t);
if (cellMin.getX() > map.getMapSettings().getMaxPos().getX()) return false;
if (cellMin.getY() > map.getMapSettings().getMaxPos().getY()) return false;
if (cellMin.getY() > map.getMapSettings().getMaxPos().getZ()) return false;
Vector2i cellMax = tileGrid.getCellMax(t);
if (cellMax.getX() < map.getMapSettings().getMinPos().getX()) return false;
return cellMax.getY() >= map.getMapSettings().getMinPos().getY();
return cellMax.getY() >= map.getMapSettings().getMinPos().getZ();
};
this.tileCount = tileSet.size();