fix: 修复空提交问题

This commit is contained in:
1
2025-11-19 00:09:12 +00:00
parent 24f2a6d7c8
commit 31439b707c
12 changed files with 88 additions and 98 deletions

View File

@@ -2,6 +2,7 @@ package controller
import (
"blazing/common/socket/errorcode"
"sync/atomic"
"blazing/logic/service/fight"
"blazing/logic/service/fight/info"
@@ -26,11 +27,11 @@ func (h Controller) UseSkill(data *fight.UseSkillInInfo, c *player.Player) (resu
// 战斗逃跑
func (h Controller) Escape(data *fight.EscapeFightInboundInfo, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
if c.FightC == nil {
if atomic.LoadUint32(&c.Fightinfo.Status) == 0 {
return nil, 0
return nil, errorcode.ErrorCodes.ErrBattleNotStarted //,没开始对战
}
if !c.FightC.CanEscape() { //用户对战不能逃跑
if atomic.LoadUint32(&c.Fightinfo.Status) == 1 { //用户对战不能逃跑
return nil, errorcode.ErrorCodes.ErrCannotFleePlayerBattle
}