Skip to content

Commit

Permalink
#676 Fix planetary status happiness explanation.
Browse files Browse the repository at this point in the history
#692 MusicTest no longer enables music after testing it silently.
  • Loading branch information
tuomount committed Apr 27, 2024
1 parent 3a25be9 commit c2884ab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions src/main/java/org/openRealmOfStars/starMap/planet/Planet.java
Original file line number Diff line number Diff line change
Expand Up @@ -4094,18 +4094,18 @@ public int calculateHappiness() {
sb.append(bonusBuildings);
sb.append("<br>");
}
int statusesBonus = statuses.stream()
.map(status -> status.getStatus().getHappinessBonus())
.reduce(0, (acc, b) -> acc + b);
if (statusesBonus != 0) {
sb.append("<li>");
sb.append(event.getName());
if (statusesBonus > 0) {
sb.append("+");
}
base = base + statusesBonus;
sb.append(statusesBonus);
sb.append("<br>");
for (AppliedStatus status : statuses) {
int statusBonus = status.getStatus().getHappinessBonus();
if (statusBonus != 0) {
sb.append("<li>");
sb.append(status.getStatus().getName());
if (statusBonus > 0) {
sb.append("+");
}
base = base + statusBonus;
sb.append(statusBonus);
sb.append("<br>");
}
}
int totalWarFatigue = planetOwnerInfo.getTotalWarFatigue();
base = base + totalWarFatigue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void testMusicPlayerByPlayingOgg() throws InterruptedException {
}
}
assertEquals(true, found);
MusicPlayer.setMusicEnabled(true);
MusicPlayer.setMusicEnabled(false);

}

Expand Down

0 comments on commit c2884ab

Please sign in to comment.