diff --git a/core/src/com/riiablo/map/DS1.java b/core/src/com/riiablo/map/DS1.java index 590308e5..02685ba2 100644 --- a/core/src/com/riiablo/map/DS1.java +++ b/core/src/com/riiablo/map/DS1.java @@ -447,7 +447,7 @@ public class DS1 { public int prop4() { return (value >>> 24) & 0xFF; } public int prop3() { return (value >>> 16) & 0xFF; } public int prop2() { return (value >>> 8) & 0xFF; } - public int prop1() { return (value >>> 0) & 0xFF; } + public int prop1() { return (value ) & 0xFF; } void setOrientation(int orientation) { this.orientation = (short) orientation; diff --git a/core/src/com/riiablo/map/Map.java b/core/src/com/riiablo/map/Map.java index 0b2f3445..1897240a 100644 --- a/core/src/com/riiablo/map/Map.java +++ b/core/src/com/riiablo/map/Map.java @@ -971,6 +971,12 @@ public class Map implements Disposable { orFlags(zone.flags, tx, ty, DT1.Tile.FLAG_BLOCK_WALK); } + if ((cell.value & DS1.Cell.FLOOR_UNWALK_MASK) == 0) { + // TODO: Technically this might not be needed since the level can be assumed enclosed + orFlags(zone.flags, tx, ty, DT1.Tile.FLAG_BLOCK_WALK); + continue; + } + if ((cell.value & DS1.Cell.HIDDEN_MASK) != 0) { continue; } @@ -982,6 +988,7 @@ public class Map implements Disposable { zone.tiles[layer][tx][ty] = null; continue; } + copyFlags(zone.flags, tx, ty, tile.tile); if (NO_FLOOR) { orFlags(zone.flags, tx, ty, DT1.Tile.FLAG_BLOCK_WALK); @@ -1000,7 +1007,6 @@ public class Map implements Disposable { int ptr = l + (y * ds1.wallLine); for (int x = 0; x < ds1.width; x++, tx++, ptr += ds1.numWalls) { DS1.Cell cell = ds1.walls[ptr]; - if (Orientation.isSpecial(cell.orientation)) { Tile tile = zone.tiles[layer][tx][ty] = Tile.of(dt1s, cell); if (ID.POPPADS.contains(cell.id)) { @@ -1017,6 +1023,10 @@ public class Map implements Disposable { } } + if ((cell.value & DS1.Cell.FLOOR_UNWALK_MASK) == 0) { + continue; + } + if ((cell.value & DS1.Cell.HIDDEN_MASK) != 0) { // This seems like all the special tiles, null usually means marker tile (start pos), // non null usually means stuff like side of river, used for ?weather? ?rain drops? @@ -1065,11 +1075,11 @@ public class Map implements Disposable { int ptr = l + (y * ds1.shadowLine); for (int x = 0; x < ds1.width; x++, tx++, ptr += ds1.numShadows) { DS1.Cell cell = ds1.shadows[ptr]; - if ((cell.value & DS1.Cell.HIDDEN_MASK) != 0) { + if ((cell.value & DS1.Cell.FLOOR_UNWALK_MASK) == 0) { continue; } - if ((cell.value & DS1.Cell.FLOOR_UNWALK_MASK) == 0) { + if ((cell.value & DS1.Cell.HIDDEN_MASK) != 0) { continue; }