Skip to content

Commit 82c3d12

Browse files
committed
dont freak out when theres an unknown build item, just note it and proceed calmly
1 parent 9829f4f commit 82c3d12

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sc2reader/resources.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,11 @@ def load_player_builds(self):
901901
# up to the first 64 successful actions in the game.
902902
BuildEntry = namedtuple('BuildEntry',['supply','total_supply','time','order','build_index'])
903903
for build_item in build_items:
904-
order_name = self.translations['enUS'][build_item[0][1]]
904+
if build_item[0][1] in self.translations['enUS']:
905+
order_name = self.translations['enUS'][build_item[0][1]]
906+
else:
907+
order_name = "Unknown"
908+
print "Unknown item in build order, key = {}".format(build_item[0][1])
905909
for pindex, commands in enumerate(build_item[1]):
906910
for command in commands:
907911
self.build_orders[pindex].append(BuildEntry(

0 commit comments

Comments
 (0)