game: fixed wrong logs formatting on multiple targets

This commit is contained in:
Oleg Agafonov 2024-06-25 10:26:47 +04:00
parent c89f78dbc5
commit e507627dae

View file

@ -1288,6 +1288,7 @@ public abstract class AbilityImpl implements Ability {
StringBuilder sb = new StringBuilder(); // threadLocal StringBuilder can't be used because calling method already uses it
if (!targets.isEmpty()) {
String usedVerb = null;
boolean isFirstTarget = true;
for (Target target : targets) {
if (!target.getTargets().isEmpty()) {
String targetHintInfo = target.getChooseHint() == null ? "" : " (" + target.getChooseHint() + ")";
@ -1300,6 +1301,12 @@ public abstract class AbilityImpl implements Ability {
usedVerb = " choosing ";
sb.append(usedVerb);
}
if (!isFirstTarget) {
sb.append(", ");
}
isFirstTarget = false;
sb.append(target.getTargetedName(game));
sb.append(targetHintInfo);
}