mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-18 11:23:27 +00:00
another go at fixing bug #12383
This commit is contained in:
parent
a41bb9e537
commit
a35b8ba332
@ -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:
|
||||
# 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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user