fix: 自动寻路时无法触发楼层传送

This commit is contained in:
AncTe committed 2024-09-28 15:32:12 +08:00
1 parent b881cc1d2e
commit c6e0573496
11 files changed
+178 -132

No files matched your search

+6 -2
View File
@@ -193,13 +193,14 @@ export function init() {
control.prototype.moveHero = async function (
direction?: Dir,
callback?: () => void
callback?: () => void,
noRoute: boolean = false
) {
if (heroMover.moving) return;
heroMover.clearMoveQueue();
heroMover.oneStep(direction ?? 'forward');
const lock = core.status.lockControl;
const controller = heroMover.startMove(false, true, lock);
const controller = heroMover.startMove(false, noRoute, lock);
controller?.onEnd.then(() => {
callback?.();
});
@@ -251,6 +252,9 @@ export function init() {
this._setAutomaticRoute_drawRoute(moveStep);
this._setAutomaticRoute_setAutoSteps(moveStep);
// ???
core.setAutoHeroMove();
// 执行移动
const steps: MoveStep[] = moveStep.map(v => {
return { type: 'dir', value: v.direction };
+1 -1
View File
@@ -184,7 +184,7 @@ export function init() {
return _executeCallback();
// @ts-ignore
core.status.automaticRoute.moveDirectly = false;
this.doSystemEvent(trigger, block, core.doAction);
this.doSystemEvent(trigger, block);
}
return _executeCallback();
};