Fix issue when overflow happens
This commit is contained in:
@@ -126,7 +126,7 @@ public class SaveLoadSystem {
|
|||||||
|
|
||||||
int nonEmptyBlockCount = 0;
|
int nonEmptyBlockCount = 0;
|
||||||
for (int i = 0; i < WorldSection.SECTION_VOLUME; i++) {
|
for (int i = 0; i < WorldSection.SECTION_VOLUME; i++) {
|
||||||
long state = lut[MemoryUtil.memGetShort(ptr)]; ptr += 2; if (VERIFY_MEMORY_ACCESS && data.size<=(ptr-data.address)) throw new IllegalStateException("Memory access OOB");
|
long state = lut[Short.toUnsignedInt(MemoryUtil.memGetShort(ptr))]; ptr += 2; if (VERIFY_MEMORY_ACCESS && data.size<=(ptr-data.address)) throw new IllegalStateException("Memory access OOB");
|
||||||
nonEmptyBlockCount += Mapper.isAir(state)?0:1;
|
nonEmptyBlockCount += Mapper.isAir(state)?0:1;
|
||||||
section.data[z2lin(i)] = state;
|
section.data[z2lin(i)] = state;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user