Skip to content

Commit

Permalink
Merge pull request #104 from cclauss/patch-1
Browse files Browse the repository at this point in the history
Set defaults when parsing editor replays
  • Loading branch information
StoicLoofah authored Nov 25, 2019
2 parents 9d97aef + 77fa358 commit 975fc8f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sc2reader/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,9 @@ def load_attribute_events(self):
self.attributes[attr.player][attr.name] = attr.value

# Populate replay with attributes
self.speed = self.attributes[16]["Game Speed"]
self.category = self.attributes[16]["Game Mode"]
self.type = self.game_type = self.attributes[16]["Teams"]
self.speed = self.attributes[16].get("Game Speed", 1.0)
self.category = self.attributes[16].get("Game Mode", "")
self.type = self.game_type = self.attributes[16].get("Teams", "")
self.is_ladder = self.category == "Ladder"
self.is_private = self.category == "Private"

Expand Down

0 comments on commit 975fc8f

Please sign in to comment.