Skip to content

Commit

Permalink
Update UnsortedCommands.java
Browse files Browse the repository at this point in the history
  • Loading branch information
xdnw committed Aug 2, 2024
1 parent f54e647 commit c8ef182
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1838,8 +1838,6 @@ public String optimalBuild(@Me JSONObject command, @Me IMessageIO io, @Me Guild
@Arg(value = "Return a result on discord in plain text", group = 3)
@Switch("w") boolean writePlaintext,
@Switch("calc") @Timediff Long calc_time


) throws Exception {
List<String> cmd = new ArrayList<>();
if (days != null) cmd.add(days + "");
Expand All @@ -1848,21 +1846,23 @@ 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();
build = jc.toCityBuild();
if (infra == null && originalInfra != null) {
build.setInfraNeeded(originalInfra);
}
if (geographicContinent == null) {
DBCity city = Locutus.imp().getNationDB().getCitiesV3ByCityId(originalCityId);
if (city != null) {
DBNation nation = city.getNation();
if (nation != null) {
cmd.add("continent=" + nation.getContinent().name());
geographicContinent = nation.getContinent();
}
}
}
}

cmd.add(build.toString());
if (buildMMR != null) cmd.add("mmr=" + buildMMR);

if (calc_time != null && calc_time > 9000) cmd.add("timeout=" + TimeUtil.secToTime(TimeUnit.MILLISECONDS, calc_time));
if (buildMMR != null) cmd.add("mmr=" + buildMMR);
if (age != null) cmd.add("age=" + age);
Expand All @@ -1884,9 +1884,7 @@ public String optimalBuild(@Me JSONObject command, @Me IMessageIO io, @Me Guild

if (moneyPositive) cmd.add("cash=" + moneyPositive);
if (geographicContinent != null) cmd.add("continent=" + geographicContinent);



System.out.println(cmd);
return new OptimalBuild().onCommand(io, guild, author, me, cmd, flags);
}

Expand Down

0 comments on commit c8ef182

Please sign in to comment.