Skip to content

Commit b4612e9

Browse files
committed
Do a proper is_type comparison for ints.
1 parent 771e3cd commit b4612e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sc2reader/data/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def __init__(self, unit_id, flags):
3232

3333
def is_type(self, unit_type):
3434
if isinstance(unit_type, int):
35-
# Compare integer ids. Unknown units have id==0 and should be equal
36-
return self._type_class.id if self._type_class else unit_type == 0
35+
# Unknown units have id==0 and should be equal
36+
return unit_type == self._type_class.id if self._type_class else unit_type == 0
3737
else:
3838
return self._type_class == unit_type
3939

0 commit comments

Comments
 (0)