update worldtask
This commit is contained in:
parent
64a50c4f57
commit
fd0580d4da
@ -93,14 +93,22 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
for _, condiId := range nextTaskConf.Completetask {
|
||||
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
|
||||
|
||||
if len(nextTaskConf.Completetask) == 1 && nextTaskConf.Completetask[0] == 0 {
|
||||
userTask.CondiIds = []int32{}
|
||||
} else {
|
||||
for _, condiId := range nextTaskConf.Completetask {
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -97,6 +97,8 @@ func (this *ModelWorldtask) finishTask(groupId, taskId int32, task *pb.DBWorldta
|
||||
update["lastTaskIds"] = task.LastTaskIds
|
||||
update["deliverNpc"] = 1
|
||||
update["condiIds"] = []int32{}
|
||||
update["npcStatus"] = 0
|
||||
update["deliverNpc"] = 0
|
||||
if err := this.Change(task.Uid, update); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user