This commit is contained in:
wh_zcy 2023-06-15 21:00:57 +08:00
parent 99a6ba5394
commit f225ec088f

View File

@ -92,11 +92,15 @@ func (a *apiComp) Accept(session comm.IUserSession, req *pb.WorldtaskAcceptReq)
} else { } else {
task.NpcStatus = 1 task.NpcStatus = 1
for _, cid := range curTaskConf.Completetask { for _, cid := range curTaskConf.Completetask {
for _, cond := range task.Conds {
if cid != cond.Conid {
task.Conds = append(task.Conds, &pb.ConIProgress{ task.Conds = append(task.Conds, &pb.ConIProgress{
Conid: cid, Conid: cid,
}) })
} }
} }
}
}
break break
} else { } else {
if tasks.TaskMap == nil { if tasks.TaskMap == nil {
@ -110,10 +114,14 @@ func (a *apiComp) Accept(session comm.IUserSession, req *pb.WorldtaskAcceptReq)
} }
for _, cid := range curTaskConf.Completetask { for _, cid := range curTaskConf.Completetask {
for _, cond := range task.Conds {
if cid != cond.Conid {
task.Conds = append(task.Conds, &pb.ConIProgress{ task.Conds = append(task.Conds, &pb.ConIProgress{
Conid: cid, Conid: cid,
}) })
} }
}
}
tasks.TaskMap[task.TaskId] = task tasks.TaskMap[task.TaskId] = task
} }
} }
@ -127,10 +135,14 @@ func (a *apiComp) Accept(session comm.IUserSession, req *pb.WorldtaskAcceptReq)
NpcStatus: 1, //接取 NpcStatus: 1, //接取
} }
for _, cid := range curTaskConf.Completetask { for _, cid := range curTaskConf.Completetask {
for _, cond := range task.Conds {
if cid != cond.Conid {
task.Conds = append(task.Conds, &pb.ConIProgress{ task.Conds = append(task.Conds, &pb.ConIProgress{
Conid: cid, Conid: cid,
}) })
} }
}
}
tasks.TaskMap[req.TaskId] = task tasks.TaskMap[req.TaskId] = task
myWorldtask.CurrentTasks[curTaskConf.Group] = tasks myWorldtask.CurrentTasks[curTaskConf.Group] = tasks
} }