another go at fixing bug #12383

This commit is contained in:
Elias Pschernig 2008-10-03 14:55:53 +00:00
parent a41bb9e537
commit a35b8ba332

View File

@ -605,11 +605,20 @@ class HTMLOutput:
if base_unit:
attacks = get_recursive_attacks(base_unit)
base_attacks = attacks[:]
for i, attack in enumerate(this_unit.get_all("attack")):
aid = attack.get_text_val("name")
if aid:
attacks.append(attack)
# The attack does have a name - either merge with the base
# which has the same name, or else append it as new attack.
for already in base_attacks:
if already.get_text_val("name") == aid:
copy_attributes(attack, already)
break
else:
attacks.append(attack)
else:
# The attack has no name, so merge based on order.
copy_attributes(attack, attacks[i])
return attacks