diff --git a/packages-user/legacy-plugin-data/src/enemy/checkblock.ts b/packages-user/legacy-plugin-data/src/enemy/checkblock.ts index a430c12..777bc33 100644 --- a/packages-user/legacy-plugin-data/src/enemy/checkblock.ts +++ b/packages-user/legacy-plugin-data/src/enemy/checkblock.ts @@ -1,6 +1,6 @@ import { has, ofDir } from '@user/data-utils'; -export function init() { +export function createCheckBlock() { // 伤害弹出 // 复写阻激夹域检测 control.prototype.checkBlock = function (forceMockery: boolean = false) { @@ -52,7 +52,7 @@ function checkMockery(loc: string, force: boolean = false) { action.push({ type: 'forbidSave', forbid: true }); action.push({ type: 'changePos', direction: dir }); const blocks = core.getMapBlocksObj(); - while (1) { + while (true) { x += dx; y += dy; const block = blocks[`${x},${y}`]; diff --git a/packages-user/legacy-plugin-data/src/enemy/index.ts b/packages-user/legacy-plugin-data/src/enemy/index.ts index 15277bf..d770bdc 100644 --- a/packages-user/legacy-plugin-data/src/enemy/index.ts +++ b/packages-user/legacy-plugin-data/src/enemy/index.ts @@ -1,6 +1,8 @@ -import { init as initCheckBlock } from './checkblock'; +import { createCheckBlock } from './checkblock'; -initCheckBlock(); +export function createEnemy() { + createCheckBlock(); +} export * from './checkblock'; export * from './remainEnemy'; diff --git a/packages-user/legacy-plugin-data/src/index.ts b/packages-user/legacy-plugin-data/src/index.ts index de47c95..8869b9d 100644 --- a/packages-user/legacy-plugin-data/src/index.ts +++ b/packages-user/legacy-plugin-data/src/index.ts @@ -4,10 +4,12 @@ import { initFiveLayer } from './fiveLayer'; import { createHook } from './hook'; import { initReplay } from './replay'; import { initUI } from './ui'; +import { createEnemy } from './enemy'; export function createLegacy() { initFallback(); loading.once('coreInit', () => { + createEnemy(); initFiveLayer(); createHook(); initReplay(); @@ -15,6 +17,7 @@ export function createLegacy() { }); } +export * from './enemy'; export * from './chase'; export * from './fallback'; export * from './fiveLayer';