refactor(logic): 重构玩家战斗状态逻辑

- 移除玩家对象上的 IsFighting 标志
- 使用 FightID 字段来表示玩家是否处于战斗状态
- 更新相关控制器中的战斗状态检查逻辑
- 删除 BattleInputSourceEntity 中的冗余代码
This commit is contained in:
2025-09-03 01:54:45 +08:00
parent a522a27e20
commit 85d0dbf527
3 changed files with 4 additions and 5 deletions

View File

@@ -33,7 +33,7 @@ func (h *Controller) MapEnter(data *maps.InInfo, c *socket.Player) (result *maps
<-time.After(5 * time.Second)
// 首次刷新
if !c.IsFighting && c.Info.MapID != 0 {
if c.FightID == "" && c.Info.MapID != 0 {
data.SpawnMonsters(c, true)
}
//循环刷新怪物
@@ -48,7 +48,7 @@ func (h *Controller) MapEnter(data *maps.InInfo, c *socket.Player) (result *maps
return
case <-ticker.C:
// 刷新当前地图的怪物
if !c.IsFighting && c.Info.MapID != 0 {
if c.FightID == "" && c.Info.MapID != 0 {
data.SpawnMonsters(c, false)
}