mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-13 04:45:02 +01:00
Reset score entry if control id doesn't match
This commit is contained in:
@@ -80,7 +80,7 @@ public class ScoreBossManager extends PlayerManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Settle
|
// Settle
|
||||||
this.ranking.settle(this.getPlayer(), build, this.getLevelId(), stars, score);
|
this.ranking.settle(this.getPlayer(), build, getControlId(), getLevelId(), stars, score);
|
||||||
|
|
||||||
// Save ranking
|
// Save ranking
|
||||||
this.ranking.save();
|
this.ranking.save();
|
||||||
|
|||||||
@@ -60,10 +60,16 @@ public class ScoreBossRankEntry implements GameDatabaseObject {
|
|||||||
this.honor = player.getHonor();
|
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
|
// Update player data
|
||||||
this.update(player);
|
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
|
// Set team entry
|
||||||
var team = new ScoreBossTeamEntry(player, build, stars, score);
|
var team = new ScoreBossTeamEntry(player, build, stars, score);
|
||||||
this.getTeams().put(level, team);
|
this.getTeams().put(level, team);
|
||||||
|
|||||||
Reference in New Issue
Block a user