Skip to content

Commit

Permalink
Fix potential bug with save/resume
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarBLG committed May 14, 2023
1 parent 745d101 commit 0d2162a
Showing 1 changed file with 3 additions and 4 deletions.
Expand Up @@ -262,16 +262,15 @@ public void Save(BinaryWriter outf)
public void Restore(BinaryReader inf)
{
int count = inf.ReadInt32();
if (AxleList.Count == 0)
for (int i = 0; i < count; i++)
{
for (int i = 0; i < count; i++)
if (i >= AxleList.Count)
{
AxleList.Add(new Axle());
AxleList[i].Initialize();
}
AxleList[i].Restore(inf);
}
foreach (var axle in AxleList)
axle.Restore(inf);
}
/// <summary>
/// Updates each axle on the list
Expand Down

0 comments on commit 0d2162a

Please sign in to comment.