Skip to content

Commit ab1b0f4

Browse files
committed
Fix selection parsing.
1 parent f98cf00 commit ab1b0f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sc2reader/readers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def player_selection_event(self, data, fstamp, pid, event_type):
316316
overlay = self._parse_selection_update(data)
317317

318318
type_count = data.read_bits(self.UNIT_INDEX_BITS)
319-
unit_types = [(data.read_bits(24),data.read_bits(self.UNIT_INDEX_BITS)) for index in range(type_count)]
319+
unit_types = [(data.read_short(BIG_ENDIAN) << 8 | data.read_byte(),data.read_bits(self.UNIT_INDEX_BITS)) for index in range(type_count)]
320320

321321
unit_count = data.read_bits(self.UNIT_INDEX_BITS)
322322
unit_ids = [data.read_bits(32) for index in range(unit_count)]
@@ -400,7 +400,7 @@ def _parse_selection_update(self, data):
400400

401401
# Represent the mask as a simple bit array with
402402
# True => Deselect, False => Keep
403-
return [bit_mask & bit for bit in self.SINGLE_BIT_MASKS[:mask_length]]
403+
mask = [bit_mask & bit for bit in self.SINGLE_BIT_MASKS[:mask_length]]
404404

405405
elif update_type == 2:
406406
index_count = data.read_bits(self.UNIT_INDEX_BITS)

0 commit comments

Comments
 (0)