Skip to content

Commit

Permalink
Merge pull request #6113 from kuronekochomusuke/weaponAttackActionSpace
Browse files Browse the repository at this point in the history
add space before weapon to hit values
  • Loading branch information
HammerGS authored Oct 17, 2024
2 parents b5110fb + bdd2777 commit 64bac03
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,9 @@ private void addDescription(EntityAction entityAction) {
*/
private void addWeaponAttackAction(WeaponAttackAction attack) {
ToHitData toHit = attack.toHit(game, true);
String table = toHit.getTableDesc();
final String buffer = toHit.getValueAsString() + ((!table.isEmpty()) ? ' ' + table : "");
String tableDesc = toHit.getTableDesc();
tableDesc = !tableDesc.isEmpty() ? ' ' + tableDesc : "";
final String toHitDesc = toHit.getValueAsString() + tableDesc;
final Entity entity = game.getEntity(attack.getEntityId());
final String weaponName = (entity.getEquipment(attack.getWeaponId()).getType()).getName();
Entity ammoCarrier = game.getEntity(attack.getAmmoCarrier());
Expand All @@ -212,14 +213,14 @@ private void addWeaponAttackAction(WeaponAttackAction attack) {
while (i.hasNext()) {
String s = i.next();
if (s.startsWith(weaponName)) {
i.set(s + ", " + buffer);
i.set(s + ", " + toHitDesc);
found = true;
break;
}
}

if (!found) {
descriptions.add( weaponName + ammoName + Messages.getString("BoardView1.needs") + buffer);
descriptions.add( weaponName + ammoName + Messages.getString("BoardView1.needs") + ' ' + toHitDesc);
}
}
}

0 comments on commit 64bac03

Please sign in to comment.