Skip to content

Commit

Permalink
Fix AutoSplitter crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Popax21 committed Nov 9, 2023
1 parent 82bcba9 commit 30694d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Celeste.Mod.mm/Mod/Everest/AutoSplitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ private static long WriteString(MemoryMappedViewAccessor view, ref long offset,
//Strings are encoded as null-terminated UTF8 strings
//Additionally, the length of the string is stored as a ushort right before the string data at offset -2
byte[] utf8Str = Encoding.UTF8.GetBytes(str);
view.Write(offset - 2, (ushort) utf8Str.Length);
view.WriteArray(offset, utf8Str, 0, utf8Str.Length);
view.Write(offset + utf8Str.Length, (byte) 0);
view.Write(offset, (ushort) utf8Str.Length);
view.WriteArray(offset + 2, utf8Str, 0, utf8Str.Length);
view.Write(offset + 2 + utf8Str.Length, (byte) 0);

long ptrOff = offset + 1;
offset += 2 + utf8Str.Length + 1;
Expand Down

0 comments on commit 30694d2

Please sign in to comment.