Skip to content

Commit 1318b23

Browse files
dsjoergGraylinKim
authored andcommitted
HotS 2.0.0.23925 replays report incorrect game lengths.
1 parent 35a6f43 commit 1318b23

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sc2reader/resources.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,12 @@ def load_events(self):
487487
self.events += self.raw_data['replay.game.events']
488488

489489
self.events = sorted(self.events, key=lambda e: e.frame)
490+
491+
# hideous hack for HotS 2.0.0.23925, see https://github.com/GraylinKim/sc2reader/issues/87
492+
if self.events[-1].frame > self.frames:
493+
self.frames = self.events[-1].frame
494+
self.length = utils.Length(seconds=int(self.frames/self.game_fps))
495+
490496
self.camera_events = list()
491497
self.selection_events = list()
492498
self.ability_events = list()

0 commit comments

Comments
 (0)