Dont write challenge history if the player didnt get any stars

This commit is contained in:
Melledy
2023-10-26 23:31:30 -07:00
parent 3dd3555e8f
commit c25803e678

View File

@@ -88,6 +88,9 @@ public class ChallengeManager extends BasePlayerManager {
}
public void addHistory(int challengeId, int stars) {
// Dont write challenge history if the player didnt get any stars
if (stars <= 0) return;
// Get history info
var info = this.getHistory().computeIfAbsent(challengeId, id -> new ChallengeHistory(getPlayer(), id));