Skip to content

Commit

Permalink
[m] Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacky720 committed Feb 25, 2024
1 parent f8794a2 commit 4e93fbc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions UndertaleModLib/Models/UndertaleAnimationCurve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ public void Unserialize(UndertaleReader reader)
Iterations = reader.ReadUInt32();

// This check is partly duplicated from UndertaleChunks.cs, but it's necessary to handle embedded curves
// (for example, those in SEQN in the TS!Underswap v1.0 demo; see issue #1414)
// (For example, those in SEQN in the TS!Underswap v1.0 demo; see issue #1414)
if (!reader.undertaleData.IsVersionAtLeast(2, 3, 1))
{
long returnPosition = reader.AbsPosition;
uint numPoints = reader.ReadUInt32();
if (numPoints > 0)
{
reader.AbsPosition += 8;
if (reader.ReadUInt32() != 0) // in 2.3 a int with the value of 0 would be set here,
if (reader.ReadUInt32() != 0) // In 2.3 a int with the value of 0 would be set here,
{ // it cannot be version 2.3 if this value isn't 0
reader.undertaleData.SetGMS2Version(2, 3, 1);
}
Expand Down
6 changes: 4 additions & 2 deletions UndertaleModLib/UndertaleChunks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1504,6 +1504,8 @@ public class UndertaleChunkACRV : UndertaleListChunk<UndertaleAnimationCurve>
public override string Name => "ACRV";

private static bool checkedForGMS2_3_1;

// See also a similar check in UndertaleAnimationCurve.cs, necessary for embedded animation curves.
private void CheckForGMS2_3_1(UndertaleReader reader)
{
if (reader.undertaleData.IsVersionAtLeast(2, 3, 1))
Expand All @@ -1522,10 +1524,10 @@ private void CheckForGMS2_3_1(UndertaleReader reader)
return;
}

reader.AbsPosition = reader.ReadUInt32(); // go to the first "Point"
reader.AbsPosition = reader.ReadUInt32(); // Go to the first "Point"
reader.Position += 8;

if (reader.ReadUInt32() != 0) // in 2.3 a int with the value of 0 would be set here,
if (reader.ReadUInt32() != 0) // In 2.3 a int with the value of 0 would be set here,
{ // it cannot be version 2.3 if this value isn't 0
reader.undertaleData.SetGMS2Version(2, 3, 1);
}
Expand Down

0 comments on commit 4e93fbc

Please sign in to comment.