Skip to content

Commit

Permalink
Fixed a dumb bug
Browse files Browse the repository at this point in the history
  • Loading branch information
DarwinBaker committed Nov 12, 2022
1 parent 1c98239 commit 8c1ee1d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions AATool/Saves/StatisticsFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public int GetKilometersFlown(JsonStream json)
return (int)Math.Round(cm / 100 / 1000);
}

public int GetCustomStat(JsonStream json, string name) =>
public int GetCustomStat(JsonStream json, string name) =>
(int)(json?["stats"]?["minecraft:custom"]?[name]?.Value ?? 0);

protected override void Update(JsonStream json, WorldState state, Contribution contribution)
Expand Down Expand Up @@ -112,6 +112,9 @@ private Dictionary<string, int> GetOldVersionCounts(string group, string json)
int pickupNameStart;
do
{
if (index < 0)
break;

pickupNameStart = jsonContent.IndexOf(prefix, index);
if (pickupNameStart > -1)
{
Expand All @@ -125,7 +128,7 @@ private Dictionary<string, int> GetOldVersionCounts(string group, string json)
if (int.TryParse(jsonContent.Substring(valueStart + 2, valueLength), out int count))
list[name] = count;
}
index = valueEnd;
index = valueEnd;
}
}
while (pickupNameStart > -1);
Expand Down

0 comments on commit 8c1ee1d

Please sign in to comment.