Skip to content

Commit 0c9b272

Browse files
committed
read even less of the map data, because we can't read part of some maps anymore and its data ggtracker doesn't need anyway.
1 parent f6b54d4 commit 0c9b272

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

sc2reader/objects.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,10 @@ def __init__(self, contents):
564564
#: The map base height (what is that?). This value is 4096*Base Height in the editor (giving a decimal value).
565565
self.base_height = data.read_uint32()/4096
566566

567+
# Leave early so we dont barf. Turns out ggtracker doesnt need
568+
# any of the map data thats loaded below.
569+
return
570+
567571
#: Load screen type: 0 = default, 1 = custom
568572
self.load_screen_type = data.read_uint32()
569573

@@ -627,10 +631,6 @@ def __init__(self, contents):
627631
#: The number of players enabled via the data editor
628632
self.player_count = data.read_uint32()
629633

630-
# Leave early so we dont barf. Turns out ggtracker doesnt need
631-
# any of the map data thats loaded below.
632-
return
633-
634634
#: A list of references to :class:`MapInfoPlayer` objects
635635
self.players = list()
636636
for i in range(self.player_count):

test_replays/test_all.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,13 @@ def test_30(self):
432432
replay = sc2reader.load_replay("test_replays/3.0.0.38215/second.SC2Replay")
433433
replay = sc2reader.load_replay("test_replays/3.0.0.38215/third.SC2Replay")
434434

435+
def test_30_map(self):
436+
for replayfilename in [
437+
"test_replays/3.0.0.38215/third.SC2Replay",
438+
]:
439+
factory = sc2reader.factories.SC2Factory()
440+
replay =factory.load_replay(replayfilename,load_level=1,load_map= True)
441+
435442

436443
class TestGameEngine(unittest.TestCase):
437444
class TestEvent(object):

0 commit comments

Comments
 (0)