Skip to content

Commit 74e77d9

Browse files
committed
Fix player bug in advanced win detection.
If the recorder is not a player (i.e. observer) then the advanced logic of team based elimination cannot be applied. So confirm condition before acting.
1 parent 2c6068e commit 74e77d9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sc2reader/processors.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,10 @@ def Full(replay):
231231
#We can't determine anything else without the recorder
232232
if 'message_events' in replay.raw:
233233

234-
# If the recorder is the last person on his team
234+
# If the recorder is the last person on his team, this obviously
235+
# doesn't apply for recorders who are observers
235236
team = replay.recorder.team
236-
if pcount[team.number] == 1:
237+
if replay.recorder.pid in replay.players and pcount[team.number] == 1:
237238

238239
# Get all other teams with at least 2 players left:
239240
conditions = lambda p: p[0] != team.number and p[1] > 1

0 commit comments

Comments
 (0)