Skip to content

Commit 8a6ed2c

Browse files
committed
Fixes lingering bug in the replay.message.events parser from restructuring of player storage
1 parent c892713 commit 8a6ed2c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sc2reader/parsers.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ def load(self, replay, filecontents):
9090
attr = self.load_attribute(replay, bytes)
9191
replay.attributes.append(attr)
9292

93-
#Uknown attributes get named as such and are not stored
94-
#Index by player, then name for ease of access later on
93+
# Uknown attributes get named as such and are not stored
94+
# because we don't know what they are
95+
# Index by player, then name for ease of access later on
9596
if attr.name != "Unknown":
9697
data[attr.player][attr.name] = attr.value
9798

@@ -156,7 +157,7 @@ def load(self, replay, filecontents):
156157
#some sort of header code
157158
elif flags & 0x0F == 0:
158159
bytes.skip(4)
159-
if player_id < len(replay.players):
160+
if player_id <= len(replay.players):
160161
replay.player[player_id].recorder = False
161162
else:
162163
pass #This "player" is an observer or something

0 commit comments

Comments
 (0)