Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fixed oversight with build data generation script which could
overwrite existing non-standard unit names, potentially breaking
downstream clients.
  • Loading branch information
frugs committed Jun 9, 2017
commit 494831a8a6556c098e76eb2fdbb018192ca642ae
7 changes: 6 additions & 1 deletion generate_build_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,14 @@ def combine_lookups(old_unit_lookup, old_ability_lookup, new_unit_lookup, new_ab
unit_lookup = collections.OrderedDict(old_unit_lookup)
ability_lookup = collections.OrderedDict(old_ability_lookup)

# Just straightforwardly add any missing units
# First just straightforwardly add any missing units
unit_lookup.update(new_unit_lookup)

# Doing this step allows us to preserve any non-standard unit names in the old build data that may have been
# overwritten in the new build data. This allows us to retain support for downstream clients using the existing
# unit names.
unit_lookup.update(old_unit_lookup)

# When merging old and new ability lookups, prefer to overwrite old cell data with new cell data when merging rows
# in the case of a key clash, but preserve old cell data if cell is empty in new ability lookup table
for ability_name, commands in new_ability_lookup.items():
Expand Down