refactor(logic): 重构玩家战斗状态逻辑
- 移除玩家对象上的 IsFighting 标志 - 使用 FightID 字段来表示玩家是否处于战斗状态 - 更新相关控制器中的战斗状态检查逻辑 - 删除 BattleInputSourceEntity 中的冗余代码
This commit is contained in:
@@ -15,7 +15,6 @@ import (
|
||||
)
|
||||
|
||||
func (h Controller) OnPlayerFightNpcMonster(data *info.FightNpcMonsterInboundInfo, c *socket.Player) (result *info.NullOutboundInfo, err errorcode.ErrorCode) {
|
||||
// c.IsFighting = true
|
||||
|
||||
ttt := info.NoteReadyToFightInfo{
|
||||
OwnerID: data.Head.UserID,
|
||||
@@ -79,7 +78,7 @@ func (h Controller) Escape(data *info.EscapeFightInboundInfo, c *socket.Player)
|
||||
c.SendPack(ttt.Pack(&info.FightOverInfo{
|
||||
Reason: 0,
|
||||
}))
|
||||
c.IsFighting = false
|
||||
c.FightID = ""
|
||||
}()
|
||||
|
||||
return nil, 0
|
||||
|
||||
Reference in New Issue
Block a user