Skip to content

Commit 904143f

Browse files
committed
BUG FIX: Set results to player when using outcome field
1 parent bd933d5 commit 904143f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

sc2reader/processors.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ def process(self, replay):
162162
#####################################################
163163

164164
class ResultsProcessor(Processor):
165+
def _process_results(self, replay):
166+
#Knowing the team results, map results to the players as well
167+
for player in replay.players:
168+
player.result = replay.results[player.team]
169+
165170
def process(self, replay):
166171
# Check if replay file has recorded the winner
167172
remaining = set()
@@ -173,8 +178,9 @@ def process(self, replay):
173178
else:
174179
remaining.add(player.team)
175180
if len(remaining) == 0:
181+
self._process_results(replay)
176182
return replay
177-
183+
178184
#Remove players from the teams as they drop out of the game
179185
print replay.teams
180186
print replay.players
@@ -229,8 +235,6 @@ def process(self, replay):
229235
for team in remaining:
230236
replay.results[team] = "Unknown"
231237

232-
#Knowing the team results, map results to the players as well
233-
for player in replay.players:
234-
player.result = replay.results[player.team]
238+
self._process_results(replay)
235239

236240
return replay

0 commit comments

Comments
 (0)