Skip to content

Commit 494831a

Browse files
committed
Fixed oversight with build data generation script which could
overwrite existing non-standard unit names, potentially breaking downstream clients.
1 parent a778a22 commit 494831a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

generate_build_data.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,14 @@ def combine_lookups(old_unit_lookup, old_ability_lookup, new_unit_lookup, new_ab
164164
unit_lookup = collections.OrderedDict(old_unit_lookup)
165165
ability_lookup = collections.OrderedDict(old_ability_lookup)
166166

167-
# Just straightforwardly add any missing units
167+
# First just straightforwardly add any missing units
168168
unit_lookup.update(new_unit_lookup)
169169

170+
# Doing this step allows us to preserve any non-standard unit names in the old build data that may have been
171+
# overwritten in the new build data. This allows us to retain support for downstream clients using the existing
172+
# unit names.
173+
unit_lookup.update(old_unit_lookup)
174+
170175
# When merging old and new ability lookups, prefer to overwrite old cell data with new cell data when merging rows
171176
# in the case of a key clash, but preserve old cell data if cell is empty in new ability lookup table
172177
for ability_name, commands in new_ability_lookup.items():

0 commit comments

Comments
 (0)