update worldtask

This commit is contained in:
wh_zcy 2023-03-24 09:29:07 +08:00
parent 64a50c4f57
commit fd0580d4da
2 changed files with 17 additions and 7 deletions

View File

@ -93,14 +93,22 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
return return
} }
for _, condiId := range nextTaskConf.Completetask {
if m, err := this.module.service.GetModule(comm.ModuleRtask); err == nil { if len(nextTaskConf.Completetask) == 1 && nextTaskConf.Completetask[0] == 0 {
iwt, ok := m.(comm.IRtask) userTask.CondiIds = []int32{}
if ok { } else {
if code = iwt.CheckCondi(uid, condiId); code != pb.ErrorCode_Success { for _, condiId := range nextTaskConf.Completetask {
return if condiId == 0 {
continue
}
if m, err := this.module.service.GetModule(comm.ModuleRtask); err == nil {
iwt, ok := m.(comm.IRtask)
if ok {
if code = iwt.CheckCondi(uid, condiId); code != pb.ErrorCode_Success {
return
}
userTask.CondiIds = append(userTask.CondiIds, condiId)
} }
userTask.CondiIds = append(userTask.CondiIds, condiId)
} }
} }
} }

View File

@ -97,6 +97,8 @@ func (this *ModelWorldtask) finishTask(groupId, taskId int32, task *pb.DBWorldta
update["lastTaskIds"] = task.LastTaskIds update["lastTaskIds"] = task.LastTaskIds
update["deliverNpc"] = 1 update["deliverNpc"] = 1
update["condiIds"] = []int32{} update["condiIds"] = []int32{}
update["npcStatus"] = 0
update["deliverNpc"] = 0
if err := this.Change(task.Uid, update); err != nil { if err := this.Change(task.Uid, update); err != nil {
return err return err
} }