Skip to content

Commit 182e276

Browse files
Minorly optimise MCForge-Redux map importer
1 parent 520a9bd commit 182e276

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

fCraft/MapConversion/MapMCF.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,12 @@ public override Map Load( string fileName ) {
2929
Map map = LoadHeaderInternal( gs );
3030
map.Blocks = new byte[map.Volume];
3131

32-
int i = 0, lo, hi;
33-
while ((lo = gs.ReadByte()) != -1) {
34-
hi = gs.ReadByte();
35-
int id = lo | (hi << 8);
32+
int i = 0, id;
33+
while ((id = gs.ReadByte()) != -1) {
34+
gs.ReadByte(); // NOTE: This breaks the 5 block ids past 255, but I doubt they really had much use.
3635

3736
if (id <= (byte)Block.StoneBrick) map.Blocks[i] = (byte)id;
38-
else map.Blocks[i] = Mapping[id & 0xFF];
39-
// NOTE: This breaks the 5 block ids past 255, but I doubt they really had much use.
37+
else map.Blocks[i] = Mapping[id];
4038
i++;
4139
}
4240
return map;

0 commit comments

Comments
 (0)