From 649432c30529a4916f0dcb498bfdc6469f3c6589 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Tue, 20 Dec 2022 20:33:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=BB=E7=BA=BF=20?= =?UTF-8?q?=E6=8B=9B=E5=8B=9F=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/worldtask/api_finish.go | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/worldtask/api_finish.go b/modules/worldtask/api_finish.go index debb8ab60..d07ea6e7d 100644 --- a/modules/worldtask/api_finish.go +++ b/modules/worldtask/api_finish.go @@ -108,6 +108,21 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe ) }() + for _, v := range curTaskConf.Reword { + if v.A == comm.HeroType { + hero = append(hero, v.T) + } + } + if len(hero) > 0 { + ishave := this.module.ModuleUser.CheckTujianHero(session, hero) + for i, v := range ishave { + if v { + newhero = append(newhero, hero[i]) + } + } + } + rsp.Newheros = newhero + // 完成任务 if err := this.module.modelWorldtask.finishTask(req.GroupId, req.TaskId, userTask); err != nil { code = pb.ErrorCode_WorldtaskFinish @@ -131,21 +146,6 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe ) } - for _, v := range curTaskConf.Reword { - if v.A == comm.HeroType { - hero = append(hero, v.T) - } - } - if len(hero) > 0 { - ishave := this.module.ModuleUser.CheckTujianHero(session, hero) - for i, v := range ishave { - if v { - newhero = append(newhero, hero[i]) - } - } - } - rsp.Newheros = newhero - } //判断任务是否已完成