Skip to content

Commit fc72a66

Browse files
committed
fix build order bug, and tests that would have caught it
1 parent ea21511 commit fc72a66

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
@@ -941,10 +941,10 @@ def load_player_stats(self):
941941
# }
942942
stat_id = item[0][1]
943943
if stat_id in translation:
944+
stat_name = translation[stat_id]
944945
# Assume anything under 1 million is a normal score screen item
945946
# Build order ids are generally 16 million+
946947
if stat_id < 1000000:
947-
stat_name = translation[stat_id]
948948
for pid, value in enumerate(item[1]):
949949
if not value: continue
950950

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)