mirror of
https://github.com/motajs/template.git
synced 2026-10-02 00:20:18 +08:00
fix(state): replace removed noRoute with replaySystem disable/revert in hero events
This commit is contained in:
parent
c08f3f8484
commit
6d3d4dbaed
@ -12,12 +12,12 @@ export class EventMoveHero implements BuiltInFunction<
|
||||
const mover = env.state.hero.location.mover;
|
||||
if (mover.moving) return;
|
||||
|
||||
mover.config({ noRoute: true });
|
||||
env.state.replaySystem.disable();
|
||||
mover.push([...param.steps]);
|
||||
const controller = mover.start();
|
||||
if (!controller) return;
|
||||
await controller.onEnd;
|
||||
mover.config({ noRoute: false });
|
||||
env.state.replaySystem.revert();
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,11 +31,11 @@ export class EventStepHero implements BuiltInFunction<
|
||||
const mover = env.state.hero.location.mover;
|
||||
if (mover.moving) return;
|
||||
|
||||
mover.config({ noRoute: true });
|
||||
env.state.replaySystem.disable();
|
||||
mover.forward(1);
|
||||
const controller = mover.start();
|
||||
if (!controller) return;
|
||||
await controller.onEnd;
|
||||
mover.config({ noRoute: false });
|
||||
env.state.replaySystem.revert();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user