战斗失败处理
This commit is contained in:
parent
0eb8fa425d
commit
f080a2fa2b
@ -55,9 +55,14 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MainlineCh
|
||||
}
|
||||
}
|
||||
// 校验通过
|
||||
code, isWin = this.module.battle.CheckBattleReport(session, req.Report)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return
|
||||
|
||||
if req.Report != nil { // 战斗失败
|
||||
code, isWin = this.module.battle.CheckBattleReport(session, req.Report)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
isWin = false
|
||||
}
|
||||
if !isWin { // 战斗失败直接返回
|
||||
// 返还
|
||||
@ -66,7 +71,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MainlineCh
|
||||
"ps": 0,
|
||||
})
|
||||
|
||||
if code = this.module.DispenseRes(session, node.PsConsume, true); code != pb.ErrorCode_Success { // 扣1点
|
||||
if code = this.module.DispenseRes(session, node.PsConsume, true); code != pb.ErrorCode_Success { // 返还预扣体力
|
||||
return
|
||||
}
|
||||
code = pb.ErrorCode_BattleNoWin
|
||||
|
Loading…
Reference in New Issue
Block a user