Skip to content

Commit 72d68ee

Browse files
committed
Fix wall loading
1 parent d3058a7 commit 72d68ee

File tree

2 files changed

+13
-40
lines changed

2 files changed

+13
-40
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Thumbs.db
77
/[Bb]uild/
88
/[Dd]ist/
99
/[Dd]oc/
10+
/[Oo]ut/
1011
# Ignore files created by posix people
1112
*~
1213
# Ignore vim swapfiles

src/World.java

+12-40
Original file line numberDiff line numberDiff line change
@@ -1141,51 +1141,23 @@ public void loadSection(int regionX, int regionY, int mapPlane, int plane) {
11411141
mapData = a.Utility.loadData(mapname + ".dat", 0, this.memberMapPack);
11421142
if ((mapData == null) || (mapData.length == 0))
11431143
throw new IOException();
1144+
11441145
int off = 0;
1145-
for (int tile = 0; tile < 2304;) {
1146-
int val = mapData[(off++)] & 0xFF;
1147-
if (val < 128)
1148-
this.wallsNorthsouth[plane][(tile++)] = (byte) val;
1149-
else {
1150-
for (int l4 = 0; l4 < val - 128; l4++) {
1151-
this.wallsNorthsouth[plane][(tile++)] = 0;
1152-
}
1153-
}
1154-
}
1146+
for (int tile = 0; tile < 2304; tile++)
1147+
wallsNorthsouth[plane][tile] = mapData[off++];
11551148

1156-
for (int tile = 0; tile < 2304;) {
1157-
int val = mapData[(off++)] & 0xFF;
1158-
if (val < 128)
1159-
this.wallsEastwest[plane][(tile++)] = (byte) val;
1160-
else {
1161-
for (int k6 = 0; k6 < val - 128; k6++) {
1162-
this.wallsEastwest[plane][(tile++)] = 0;
1163-
}
1164-
}
1165-
}
1149+
for (int tile = 0; tile < 2304; tile++)
1150+
wallsEastwest[plane][tile] = mapData[off++];
11661151

1167-
for (int tile = 0; tile < 2304;) {
1168-
int val = mapData[(off++)] & 0xFF;
1169-
if (val < 128)
1170-
this.wallsDiagonal[plane][(tile++)] = val;
1171-
else {
1172-
for (int i = 0; i < val - 128; i++) {
1173-
this.wallsDiagonal[plane][(tile++)] = 0;
1174-
}
1175-
}
1176-
}
1152+
for (int tile = 0; tile < 2304; tile++)
1153+
wallsDiagonal[plane][tile] = mapData[off++] & 0xff;
11771154

1178-
for (int tile = 0; tile < 2304;) {
1179-
int val = mapData[(off++)] & 0xFF;
1180-
if (val < 128)
1181-
// "why??" -- original comment by eXemplar in the 204 deob
1182-
// without the +12000, floor tiles in the corners don't get displayed at 45 degree angle
1183-
// but also legit diagonal walls don't get displayed at a 45 degree angle either.
1184-
this.wallsDiagonal[plane][(tile++)] = (val + 12000);
1185-
else {
1186-
tile += val - 128;
1187-
}
1155+
for (int tile = 0; tile < 2304; tile++) {
1156+
int val = mapData[off++] & 0xff;
1157+
if (val > 0)
1158+
wallsDiagonal[plane][tile] = val + 12000;
11881159
}
1160+
11891161
for (int tile = 0; tile < 2304;) {
11901162
int val = mapData[(off++)] & 0xFF;
11911163
if (val < 128)

0 commit comments

Comments
 (0)