Skip to content

Commit 6c53b14

Browse files
committed
Additional s2gs bug fixes from the upgrade.
1 parent 97741fe commit 6c53b14

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sc2reader/resources.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ def __init__(self, summary_file, filename=None, **options):
694694
self.parts.append(buffer.read_data_struct())
695695

696696
# Parse basic info
697-
self.game_speed = GAME_SPEED_CODES[''.join(reversed(self.parts[0][0][1]))]
697+
self.game_speed = GAME_SPEED_CODES[self.parts[0][0][1]]
698698

699699
# time struct looks like this:
700700
# { 0: 11987, 1: 283385849, 2: 1334719793L}
@@ -792,7 +792,7 @@ def load_player_info(self):
792792
player_struct = self.parts[0][3][i]
793793

794794
player = PlayerSummary(player_struct[0][0])
795-
player.race = RACE_CODES[''.join(reversed(player_struct[2]))]
795+
player.race = RACE_CODES[player_struct[2]]
796796

797797
# TODO: Grab team id from lobby_player_properties
798798
player.teamid = 0

sc2reader/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,8 @@ def get_unit(type_int):
563563
"""
564564
# Try to parse a unit
565565
unit_code = ((type_int & 0xff) << 8) | 0x01
566-
if unit_code in Data.types:
567-
unit_name = Data.type(unit_code).name
566+
if unit_code in Data.units:
567+
unit_name = Data.units[unit_code].name
568568
else:
569569
unit_name = "Unknown Unit ({0:X})".format(type_int)
570570

0 commit comments

Comments
 (0)