fix: 修复空提交问题
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user