Reset score entry if control id doesn't match

This commit is contained in:
Melledy
2025-11-30 23:42:34 -08:00
parent 3171bce3cc
commit 354f390c3b
2 changed files with 8 additions and 2 deletions

View File

@@ -80,7 +80,7 @@ public class ScoreBossManager extends PlayerManager {
}
// Settle
this.ranking.settle(this.getPlayer(), build, this.getLevelId(), stars, score);
this.ranking.settle(this.getPlayer(), build, getControlId(), getLevelId(), stars, score);
// Save ranking
this.ranking.save();

View File

@@ -60,10 +60,16 @@ public class ScoreBossRankEntry implements GameDatabaseObject {
this.honor = player.getHonor();
}
public void settle(Player player, StarTowerBuild build, int level, int stars, int score) {
public void settle(Player player, StarTowerBuild build, int controlId, int level, int stars, int score) {
// Update player data
this.update(player);
// Reset score entry if control id doesn't match
if (this.controlId != controlId) {
this.controlId = controlId;
this.getTeams().clear();
}
// Set team entry
var team = new ScoreBossTeamEntry(player, build, stars, score);
this.getTeams().put(level, team);