Skip to content

Commit c860d8e

Browse files
committed
fix for replays that started with a load from a saved game
1 parent b35d88c commit c860d8e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

sc2reader/events/tracker.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ class TrackerEvent(Event):
1515
"""
1616
def __init__(self, frames):
1717
#: The frame of the game this event was applied
18-
self.frame = frames
18+
#: Ignore all but the lowest 32 bits of the frame
19+
self.frame = frames % 2**32
1920

2021
#: The second of the game (game time not real time) this event was applied
21-
self.second = frames >> 4
22+
self.second = self.frame >> 4
2223

2324
#: Short cut string for event class name
2425
self.name = self.__class__.__name__

sc2reader/resources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ def load_game_events(self):
496496
self.events = sorted(self.events+self.game_events, key=lambda e: e.frame)
497497

498498
# hideous hack for HotS 2.0.0.23925, see https://github.com/GraylinKim/sc2reader/issues/87
499-
if self.events and self.events[-1].frame > self.frames:
499+
if self.base_build == 23925 and self.events and self.events[-1].frame > self.frames:
500500
self.frames = self.events[-1].frame
501501
self.length = utils.Length(seconds=int(self.frames/self.game_fps))
502502

0 commit comments

Comments
 (0)