Skip to content

Commit d5029d6

Browse files
committed
Save raw (obj_id,obj_type) entries to raw_objects.
This way SelectionEvent.object can still represent the unit list loaded from context and we don't lose the original values for post mortem debugging.
1 parent cc2aacd commit d5029d6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

sc2reader/events.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,7 @@ def load_context(self, replay):
176176
for player in replay.players:
177177
self.logger.error("\t"+str(player))
178178

179-
#print [hex(key) for key in sorted(replay.datapack.abilities.keys())]
180179
self.logger.error("{0}\t{1}\tMissing ability {2} from {3}".format(self.frame, self.player.name, hex(self.ability_code), replay.datapack.__class__.__name__))
181-
print "{0}\t{1}\tMissing ability {2} from {3}".format(self.frame, self.player.name, hex(self.ability_code), replay.datapack.id)
182180

183181
else:
184182
self.ability = replay.datapack.abilities[self.ability_code]
@@ -297,7 +295,7 @@ class SelectionEvent(PlayerActionEvent):
297295
def __init__(self, frame, pid, event_type, bank, objects, deselect):
298296
super(SelectionEvent, self).__init__(frame, pid, event_type)
299297
self.bank = bank
300-
self.objects = objects
298+
self.raw_objects = objects
301299
self.deselect = deselect
302300

303301
def load_context(self, replay):
@@ -308,7 +306,7 @@ def load_context(self, replay):
308306

309307
objects = list()
310308
data = replay.datapack
311-
for (obj_id, obj_type) in self.objects:
309+
for (obj_id, obj_type) in self.raw_objects:
312310
if (obj_id, obj_type) in replay.objects:
313311
obj = replay.objects[(obj_id,obj_type)]
314312
else:

0 commit comments

Comments
 (0)