Skip to content

Commit

Permalink
Update WarDB.java
Browse files Browse the repository at this point in the history
  • Loading branch information
xdnw committed Sep 4, 2024
1 parent 04730ed commit 14e5096
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/link/locutus/discord/db/WarDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -1869,7 +1869,8 @@ public boolean updateWars(List<DBWar> dbWars, Collection<Integer> expectedIds, C

for (DBWar war : dbWars) {
DBWar existing = warsById.get(war);
if ((existing == null && !war.isActive()) || (existing != null && (war.getStatus() == existing.getStatus() || !existing.isActive()))) continue;
if ((existing == null && !war.isActive()) || (existing != null && (war.getStatus() == existing.getStatus() ||
(!existing.isActive() && (existing.getStatus() != WarStatus.EXPIRED || existing.getTurnsLeft() <= 0))))) continue;

prevWars.add(existing == null ? null : new DBWar(existing));
newWars.add(war);
Expand Down

0 comments on commit 14e5096

Please sign in to comment.