From 108b59823c408c2ba654b16817d73a2991336b07 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 13 Jun 2023 15:37:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E5=88=B0=E6=88=98=E6=8A=A5=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=B8=85=E7=A9=BA=E9=A2=84=E6=89=A3=E4=BD=93=E5=8A=9B?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hunting/api_challenge.go | 2 +- modules/hunting/api_challengeover.go | 10 +--------- modules/viking/api_challenge.go | 2 +- modules/viking/api_challengeover.go | 10 +--------- 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/modules/hunting/api_challenge.go b/modules/hunting/api_challenge.go index 4b91c8873..12fc38546 100644 --- a/modules/hunting/api_challenge.go +++ b/modules/hunting/api_challenge.go @@ -47,7 +47,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.HuntingChallen return } - if v1, ok := hunting.Ps[req.BossType]; ok && v1 == 0 { + if v1, ok := hunting.Ps[req.BossType]; ok && v1 != 0 { if errdata = this.module.ConsumeRes(session, cfgData.PsMg, true); errdata != nil { // 扣1点 diff --git a/modules/hunting/api_challengeover.go b/modules/hunting/api_challengeover.go index a9c4417b2..00071e5fe 100644 --- a/modules/hunting/api_challengeover.go +++ b/modules/hunting/api_challengeover.go @@ -1,7 +1,6 @@ package hunting import ( - "fmt" "go_dreamfactory/comm" "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" @@ -75,14 +74,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha } errdata, bWin = this.module.battle.CheckBattleReport(session, req.Report) - if v, ok := hunting.Ps[req.BossType]; !ok || v == 0 { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_HuntingLvErr, - Title: pb.ErrorCode_HuntingLvErr.ToString(), - Message: fmt.Sprintf("关卡体力参数异常:%s,预扣体力:%d", session.GetUserId(), v), - } - return - } + hunting.Ps[req.BossType] = 0 // 清空预扣体力值 mapData["ps"] = hunting.Ps diff --git a/modules/viking/api_challenge.go b/modules/viking/api_challenge.go index bea7f29c3..a727a60c5 100644 --- a/modules/viking/api_challenge.go +++ b/modules/viking/api_challenge.go @@ -38,7 +38,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.VikingChalleng return } - if v1, ok := viking.Ps[req.BossId]; ok && v1 == 0 { + if v1, ok := viking.Ps[req.BossId]; ok && v1 != 0 { if errdata = this.module.ConsumeRes(session, cfgData.PsMg, true); errdata != nil { // 扣1点 return } diff --git a/modules/viking/api_challengeover.go b/modules/viking/api_challengeover.go index e98b80ee0..50f1cc963 100644 --- a/modules/viking/api_challengeover.go +++ b/modules/viking/api_challengeover.go @@ -1,7 +1,6 @@ package viking import ( - "fmt" "go_dreamfactory/comm" "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" @@ -78,14 +77,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal } errdata, bWin = this.module.battle.CheckBattleReport(session, req.Report) - if v, ok := viking.Ps[req.BossId]; !ok || v == 0 { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_VikingStagePsErr, - Title: pb.ErrorCode_VikingStagePsErr.ToString(), - Message: fmt.Sprintf("关卡体力参数异常,uid:%s,预扣体力:%d", session.GetUserId(), v), - } - return - } + viking.Ps[req.BossId] = 0 // 清空预扣体力值 mapData["ps"] = viking.Ps if !bWin { // 战斗失败了 直接返回