fix(hero): 在战斗阶段停止英雄和怪物移动
避免战斗阶段英雄和怪物位置异常变化,确保战斗逻辑与移动逻辑分离。
This commit is contained in:
@@ -103,6 +103,10 @@ export class MoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
|||||||
update(e: ecs.Entity) {
|
update(e: ecs.Entity) {
|
||||||
/** 战斗未开始/暂停时不驱动移动 */
|
/** 战斗未开始/暂停时不驱动移动 */
|
||||||
if (!smc.mission.play || smc.mission.pause) return;
|
if (!smc.mission.play || smc.mission.pause) return;
|
||||||
|
|
||||||
|
/** 在战斗阶段,英雄和怪物不移动 */
|
||||||
|
if (smc.mission.in_fight) return;
|
||||||
|
|
||||||
const model = e.get(HeroAttrsComp);
|
const model = e.get(HeroAttrsComp);
|
||||||
const move = e.get(MoveComp);
|
const move = e.get(MoveComp);
|
||||||
const view = e.get(HeroViewComp);
|
const view = e.get(HeroViewComp);
|
||||||
|
|||||||
Reference in New Issue
Block a user