Fixed issue setting flags for multiple rows

This commit is contained in:
Collin Smith 2019-11-21 01:58:12 -08:00
parent d6f8de3b86
commit 2e264abb66

View File

@ -637,10 +637,10 @@ public class Map implements Disposable {
if (width == 0 || height == 0) return;
int x0 = round(position.x - width / 2f);
int y0 = round(position.y - height / 2f);
for (int x = 0; x < width; x++, x0++) {
for (int y = 0; y < height; y++, y0++) {
Zone zone = getZone(x0, y0);
if (zone != null) zone.or(x0, y0, flags);
for (int x = 0, dx = x0; x < width; x++, dx++) {
for (int y = 0, dy = y0; y < height; y++, dy++) {
Zone zone = getZone(dx, dy);
if (zone != null) zone.or(dx, dy, flags);
}
}
}