From e9c5f8e9419af1fd3ff6294ebfedcbeb47f18738 Mon Sep 17 00:00:00 2001 From: Craig Dods Date: Sat, 15 Jul 2023 16:49:43 -0400 Subject: [PATCH] 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' --- 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..ce5adb99 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 is not None: + self.last_target_ability_event[event.player.pid] = event + if not replay.datapack: return