fix: multiple savefile fixes

This commit is contained in:
NOTPIES
2026-03-12 00:16:48 -03:00
parent c1a9648bf4
commit ff2cb7b582
13 changed files with 102 additions and 54 deletions

View File

@@ -602,9 +602,10 @@ bool SparseDataStorage::isCompressed()
void SparseDataStorage::write(DataOutputStream *dos)
{
int count = ( dataAndCount >> 48 ) & 0xffff;
__int64 snapshot = dataAndCount;
int count = ( snapshot >> 48 ) & 0xffff;
dos->writeInt(count);
unsigned char *dataPointer = (unsigned char *)(dataAndCount & 0x0000ffffffffffff);
unsigned char *dataPointer = (unsigned char *)(snapshot & 0x0000ffffffffffff);
byteArray wrapper(dataPointer, count * 128 + 128);
dos->write(wrapper);
}