Skip to content

Commit

Permalink
wmlunits: Exclude races consisting only of hidden units from the sidebar
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
irydacea committed Aug 30, 2017
1 parent 68de9ec commit 8139eab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion data/tools/unit_tree/html_output.py
Expand Up @@ -637,7 +637,8 @@ def end_menu(is_table_container=False):
# Some add-ons use race names consisting of only whitespace for
# hiding races in the UI. We need to skip those since otherwise
# they result in unusual markup (e.g. invisible <a> elements).
if not r.strip():
if not r.strip() or \
not [uid for uid in races[r] if not self.wesnoth.unit_lookup[uid].hidden]:
continue
race_url = "%s#%s" % (cleanurl(target), cleanurl(r))
add_menu("", r, "unitmenu", url=race_url)
Expand Down

0 comments on commit 8139eab

Please sign in to comment.