Skip to content

Commit

Permalink
Fix unfinished runs being assigned duplicate ids.
Browse files Browse the repository at this point in the history
  • Loading branch information
tinyhoot committed Jan 14, 2025
1 parent 0134b5c commit 8208e25
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions DeathrunRemade/Handlers/RunHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public void DeleteRun(int id, float scoreTotal)
public void StartNewRun(SaveData save)
{
int id = GetNewRunID();
// Immediately save to keep track of the number of attempted runs, not just the number of deaths.
_ = ModStats.SaveAsync();
_log.Info($"Starting new run with id {id}");
// The stats themselves do not need to be initialised because they are contained in a struct set up in
// tandem with the save file. The struct defaults to values recognised as the player having done nothing.
Expand Down

0 comments on commit 8208e25

Please sign in to comment.