Skip to content

Commit 85b4507

Browse files
committed
Fix some small rebase bugs.
1 parent 90c5c9d commit 85b4507

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

sc2reader/engine/plugins/context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ def handleSelectionEvent(self, event, replay):
6767
if unit_id in replay.objects:
6868
unit = replay.objects[unit_id]
6969
if not unit.is_type(unit_type):
70-
replay.datapack.change_type(unit, unit_type, self.frame)
70+
replay.datapack.change_type(unit, unit_type, event.frame)
7171
else:
72-
unit = replay.datapack.create_unit(unit_id, unit_type, 0x00, self.frame)
72+
unit = replay.datapack.create_unit(unit_id, unit_type, 0x00, event.frame)
7373
replay.objects[unit_id] = unit
7474

7575
# If we have tracker events, the unit must already exist and must already

test_replays/test_all.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,12 @@ def test_map_info(self):
286286

287287
def test_plugins(self):
288288
from sc2reader.engine.plugins import ContextLoader, APMTracker, SelectionTracker
289+
from sc2reader.factories.plugins.replay import toJSON
289290

290-
replay = sc2reader.load_replay(
291+
from sc2reader.factories import SC2Factory
292+
factory = SC2Factory()
293+
factory.register_plugin('Replay', toJSON())
294+
replay = factory.load_replay(
291295
"test_replays/2.0.5.25092/cn1.SC2Replay",
292296
engine=sc2reader.engine.GameEngine(plugins=[
293297
ContextLoader(),

0 commit comments

Comments
 (0)