Skip to content

Commit

Permalink
Set defaults when parsing editor replays
Browse files Browse the repository at this point in the history
Fixes #103
  • Loading branch information
cclauss authored Nov 24, 2019
1 parent 9d97aef commit 77fa358
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 77fa358

Please sign in to comment.