Fix disc secondary skills

This commit is contained in:
Melledy
2025-12-04 16:25:18 -08:00
parent be84e0f406
commit c19aa5d0a1
5 changed files with 156 additions and 3 deletions

View File

@@ -327,9 +327,18 @@ public class StarTowerManager extends PlayerManager {
// Database
public void loadFromDatabase() {
// Init builds
this.builds = new Long2ObjectOpenHashMap<>();
// Load builds with the current player's uid
Nebula.getGameDatabase().getObjects(StarTowerBuild.class, "playerUid", getPlayerUid()).forEach(build -> {
// Fix outdated builds
if (build.getSecondarySkills() == null) {
build.calculateScore();
build.save();
}
// Add build
this.builds.put(build.getUid(), build);
});
}