From e289f3aa747f69ca992b0b6f593e53a1f7e6b0e8 Mon Sep 17 00:00:00 2001 From: Craig Dods Date: Sun, 16 Jul 2023 09:15:17 -0400 Subject: [PATCH] 1 of 2 changes to support bot replays in ggtracker#149 (#1) * 1 of 2 changes to support bot replays in ggtracker#149 One of two fixes This one corrects for the error we see here: sc2reader/engine/plugins/context.py", line 66, in handleTargetUnitCommandEvent self.last_target_ability_event[event.player.pid] = event AttributeError: 'NoneType' object has no attribute 'pid' * Update sc2reader/engine/plugins/context.py Co-authored-by: Christian Clauss --------- Co-authored-by: Christian Clauss --- sc2reader/engine/plugins/context.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sc2reader/engine/plugins/context.py b/sc2reader/engine/plugins/context.py index 5a8fb34a..5206db27 100644 --- a/sc2reader/engine/plugins/context.py +++ b/sc2reader/engine/plugins/context.py @@ -63,7 +63,9 @@ def handleCommandEvent(self, event, replay): self.logger.error("Other unit {0} not found".format(event.other_unit_id)) def handleTargetUnitCommandEvent(self, event, replay): - self.last_target_ability_event[event.player.pid] = event + if event.player: + self.last_target_ability_event[event.player.pid] = event + if not replay.datapack: return