Skip to content

Commit

Permalink
Cache attack data here too
Browse files Browse the repository at this point in the history
  • Loading branch information
xdnw committed May 17, 2024
1 parent 89024f2 commit 2c3c4fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,7 @@ public String onCommand(IMessageIO io, Guild guild, User author, DBNation me, Li
cityEntry.update(true);
me = Locutus.imp().getNationDB().getNation(cityEntry.getNationId());
origin = cityEntry.toJavaCity(me);

checkup(io, me, cityId, origin); // show help

// if (days == null)
{
origin.zeroNonMilitary();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,11 @@ public void onAttack(AttackEvent event) {
AbstractCursor attack = event.getAttack();
DBWar war = attack.getWar();
if (war != null) {
updateAttack(war, attack, f -> true, f -> f.getSubCategory(DBNation::getActive_m));
updateAttack(war, attack, f -> true, f -> {
AttackTypeSubCategory cat = f.getSubCategory(DBNation::getActive_m);
saveSubTypes(Map.of(attack.getWar_attack_id(), cat == null ? -1 : (byte) cat.ordinal()));
return cat;
});
}
}

Expand Down

0 comments on commit 2c3c4fd

Please sign in to comment.