Skip to content

Commit

Permalink
Handle room view following object ID being -100
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobby233Liu committed Jan 21, 2025
1 parent 66e0fb9 commit 8172a1b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion UndertaleModLib/Models/UndertaleRoom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,13 @@ public void Unserialize(UndertaleReader reader)
BorderY = reader.ReadUInt32();
SpeedX = reader.ReadInt32();
SpeedY = reader.ReadInt32();
_objectId = reader.ReadUndertaleObject<UndertaleResourceById<UndertaleGameObject, UndertaleChunkOBJT>>();
_objectId = new UndertaleResourceById<UndertaleGameObject, UndertaleChunkOBJT>();
int readObjectId = reader.ReadInt32();
// Let's do the same thing done while reading parent object ID in UndertaleGameObject.
// FIXME: This likely causes serialization inaccuracy
if (readObjectId == -100) // undefined
readObjectId = -1;
_objectId.UnserializeById(reader, readObjectId);
}

/// <inheritdoc/>
Expand Down

0 comments on commit 8172a1b

Please sign in to comment.