Skip to content

Commit 5b33c4c

Browse files
committed
Only actually write the recalculations if wanted
1 parent db8cbe8 commit 5b33c4c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Refresh.Database/GameDatabaseContext.Statistics.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,16 +252,16 @@ public void RecalculateScoreStatistics(int levelId, byte scoreType, bool saveCha
252252
previousScore = score.Score;
253253
}
254254

255-
this.SaveChanges();
255+
if (saveChanges) this.SaveChanges();
256256
}
257257

258-
public void RecalculateScoreStatistics(GameLevel level)
258+
public void RecalculateScoreStatistics(GameLevel level, bool saveChanges = true)
259259
{
260260
this.RecalculateScoreStatistics(level.LevelId, 1, false);
261261
this.RecalculateScoreStatistics(level.LevelId, 2, false);
262262
this.RecalculateScoreStatistics(level.LevelId, 3, false);
263263
this.RecalculateScoreStatistics(level.LevelId, 4, false);
264-
this.SaveChanges();
264+
if (saveChanges) this.SaveChanges();
265265
}
266266

267267
#endregion

0 commit comments

Comments
 (0)