chore: 修复两个 eslint 报错

This commit is contained in:
unanmed 2025-09-23 10:41:51 +08:00
parent d1d6ebbdcb
commit 7cbe35e246
2 changed files with 4 additions and 3 deletions

View File

@ -133,7 +133,7 @@ export function patchBattle() {
// const enemy = getSingleEnemy(data.id as EnemyIds); // const enemy = getSingleEnemy(data.id as EnemyIds);
// todo: 与不在地图上的怪物战斗 // todo: 与不在地图上的怪物战斗
} else { } else {
if (data.floorId != core.status.floorId) { if (data.floorId !== core.status.floorId) {
core.doAction(); core.doAction();
return; return;
} }
@ -246,7 +246,7 @@ export function patchBattle() {
} else core.drawHeroAnimate(animate); } else core.drawHeroAnimate(animate);
// 如果已有事件正在处理中 // 如果已有事件正在处理中
if (core.status.event.id == null) core.continueAutomaticRoute(); if (isNil(core.status.event.id)) core.continueAutomaticRoute();
else core.clearContinueAutomaticRoute(); else core.clearContinueAutomaticRoute();
core.checkAutoEvents(); core.checkAutoEvents();

View File

@ -1,6 +1,7 @@
import { Patch, PatchClass } from '@motajs/legacy-common'; import { Patch, PatchClass } from '@motajs/legacy-common';
import { EnemyCollection, ensureFloorDamage } from '@user/data-state'; import { EnemyCollection, ensureFloorDamage } from '@user/data-state';
import { formatDamage } from '@user/data-utils'; import { formatDamage } from '@user/data-utils';
import { isNil } from 'lodash-es';
export function patchDamage() { export function patchDamage() {
const patch = new Patch(PatchClass.Control); const patch = new Patch(PatchClass.Control);
@ -13,7 +14,7 @@ export function patchDamage() {
) { ) {
if (!floorId || core.status.gameOver || main.mode !== 'play') if (!floorId || core.status.gameOver || main.mode !== 'play')
return; return;
const onMap = ctx == null; const onMap = isNil(ctx);
const floor = core.status.maps[floorId]; const floor = core.status.maps[floorId];
// 没有怪物手册 // 没有怪物手册