Skip to content

Commit 71638b0

Browse files
dsjoergGraylinKim
authored andcommitted
fix build order bug, and tests that would have caught it
1 parent cd3d2d5 commit 71638b0

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

sc2reader/resources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,10 +945,10 @@ def load_player_stats(self):
945945
# }
946946
stat_id = item[0][1]
947947
if stat_id in translation:
948+
stat_name = translation[stat_id]
948949
# Assume anything under 1 million is a normal score screen item
949950
# Build order ids are generally 16 million+
950951
if stat_id < 1000000:
951-
stat_name = translation[stat_id]
952952
for pid, value in enumerate(item[1]):
953953
if not value: continue
954954

test_s2gs/test_all_s2gs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
def test_a_WoL_s2gs():
1414
summary = sc2reader.load_game_summary("test_s2gs/s2gs1.s2gs")
1515
assert summary.players[0].resource_collection_rate == 1276
16+
assert summary.players[0].build_order[0].order == 'Probe'
1617

1718
def test_a_HotS_s2gs():
1819
summary = sc2reader.load_game_summary("test_s2gs/hots1.s2gs")
1920
assert summary.players[0].resource_collection_rate == 1599
21+
assert summary.players[0].build_order[0].order == 'SCV'

0 commit comments

Comments
 (0)