diff --git a/src/main/java/link/locutus/discord/commands/manager/v2/impl/pw/commands/UnsortedCommands.java b/src/main/java/link/locutus/discord/commands/manager/v2/impl/pw/commands/UnsortedCommands.java index e0bfdda9..80e82c4e 100644 --- a/src/main/java/link/locutus/discord/commands/manager/v2/impl/pw/commands/UnsortedCommands.java +++ b/src/main/java/link/locutus/discord/commands/manager/v2/impl/pw/commands/UnsortedCommands.java @@ -1846,10 +1846,10 @@ public String optimalBuild(@Me JSONObject command, @Me IMessageIO io, @Me Guild int originalCityId = build.getCity_id(); JavaCity jc = new JavaCity(build); jc.zeroNonMilitary(); - Integer originalInfra = build.getInfraNeeded(); + double cityInfra = jc.getInfra(); build = jc.toCityBuild(); - if (infra == null && originalInfra != null) { - build.setInfraNeeded(originalInfra); + if (infra == null && cityInfra > build.getInfraNeeded()) { + build.setInfraNeeded((int) cityInfra); } if (geographicContinent == null) { DBCity city = Locutus.imp().getNationDB().getCitiesV3ByCityId(originalCityId); diff --git a/src/main/java/link/locutus/discord/util/update/AllianceListener.java b/src/main/java/link/locutus/discord/util/update/AllianceListener.java index 111e36b9..6f846134 100644 --- a/src/main/java/link/locutus/discord/util/update/AllianceListener.java +++ b/src/main/java/link/locutus/discord/util/update/AllianceListener.java @@ -254,6 +254,7 @@ public static void runMilitarizationAlerts() { graphData = null; } byte[] finalGraphData = graphData; + System.out.println("Send aa militarize message " + alertAlliances.size() + " | " + alertAlliances.keySet()); AlertUtil.forEachChannel(f -> true, GuildKey.AA_GROUND_UNIT_ALERTS, new BiConsumer() { @Override @@ -302,6 +303,7 @@ public void accept(MessageChannel channel, GuildDB db) { msg.append(role.getAsMention()); } + System.out.println("Send aa militarize message " + title + " | " + body); msg.send(); } });