fix(core): Fixes issues with deserialization due to bad checking of dirty tracking (#618)

Fixes a major issue where serialization was not respecting the dirty tracking feature flag.
This commit is contained in:
Kamron Batman 2021-05-26 13:47:04 -07:00 committed by GitHub
parent 3c6356e8fa
commit 1f499b00c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 16 additions and 7 deletions

View file

@ -39,6 +39,14 @@ namespace Server
public void InitializeSaveBuffer(byte[] buffer)
{
SaveBuffer = new BufferWriter(buffer, true);
if (World.DirtyTrackingEnabled)
{
SavePosition = SaveBuffer.Position;
}
else
{
SavePosition = -1;
}
}
public void Serialize()
@ -59,6 +67,10 @@ namespace Server
{
SavePosition = SaveBuffer.Position;
}
else
{
SavePosition = -1;
}
}
}
}