fix(game): 修复召唤按钮第二次失效和实习生不攻击的Bug

This commit is contained in:
Cloud Bot
2026-03-21 09:00:43 +00:00
parent caf9c698c9
commit 27ba03260f
3 changed files with 11 additions and 2 deletions

View File

@@ -100,7 +100,8 @@ export abstract class TowerBase {
}
protected findTarget(enemies: EnemyBase[]): EnemyBase | null {
const rangePx = this.attackRange * this.cellW
// +0.5格容忍量,避免怪物恰好在射程边界时因浮点误差漏判
const rangePx = (this.attackRange + 0.5) * this.cellW
let best: EnemyBase | null = null
let bestProgress = -1
for (const e of enemies) {