上传商队任务接取逻辑优化
This commit is contained in:
parent
aa692be3a2
commit
1bc39a1114
@ -50,14 +50,6 @@ func (this *apiComp) Accept(session comm.IUserSession, req *pb.WTaskAcceptReq) (
|
|||||||
ok = true
|
ok = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if conf.Des == 5 { //商队任务 接取任务时 移除下一个任务的完成条件 方便顺序获取任务
|
|
||||||
for i, v := range wtask.Completes {
|
|
||||||
if conf.IdAfter != 0 && conf.IdAfter == v {
|
|
||||||
wtask.Completes = append(wtask.Completes[0:i], wtask.Completes[i+1:]...)
|
|
||||||
update["completes"] = wtask.Completes
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if !ok {
|
if !ok {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
|
@ -111,6 +111,15 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WTaskFinishReq) (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
wtask.Completes = append(wtask.Completes, req.Tid)
|
wtask.Completes = append(wtask.Completes, req.Tid)
|
||||||
|
|
||||||
|
if conf.Des == 5 { //商队任务 完成任务时 移除下一个任务的完成条件 方便顺序获取任务
|
||||||
|
for i, v := range wtask.Completes {
|
||||||
|
if conf.IdAfter != 0 && conf.IdAfter == v {
|
||||||
|
wtask.Completes = append(wtask.Completes[0:i], wtask.Completes[i+1:]...)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
session.SendMsg(string(this.module.GetType()), "finish", &pb.WTaskFinishResp{Tid: req.Tid, Award: award})
|
session.SendMsg(string(this.module.GetType()), "finish", &pb.WTaskFinishResp{Tid: req.Tid, Award: award})
|
||||||
this.module.checkgroupState(session, wtask, conf.Group)
|
this.module.checkgroupState(session, wtask, conf.Group)
|
||||||
this.module.fishtask(session, wtask, true)
|
this.module.fishtask(session, wtask, true)
|
||||||
|
@ -220,7 +220,7 @@ func (this *WTask) AcceptCaravanTask(session comm.IUserSession, groupId int32) (
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, v := range grouptask {
|
for _, v := range grouptask {
|
||||||
if _, ok = completeMap[v.Key]; v.LockAdd == 1 || !ok { //找到一个为完成任务
|
if _, ok = completeMap[v.Key]; !ok { //找到一个为完成任务
|
||||||
target = v
|
target = v
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user