From 4ff30359932fe74b895046b18444cc6a954bcc0f Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Thu, 4 Sep 2025 14:07:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20getRemainEnemyString=20=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=20extern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages-user/legacy-plugin-data/src/enemy/checkblock.ts | 4 ++-- packages-user/legacy-plugin-data/src/enemy/index.ts | 6 ++++-- packages-user/legacy-plugin-data/src/index.ts | 3 +++ 3 files changed, 9 insertions(+), 4 deletions(-) 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';