修改参数长度判断
This commit is contained in:
parent
9bb0d46e95
commit
dcef2d09e3
@ -132,7 +132,7 @@ func (a *apiComp) Accept(session comm.IUserSession, req *pb.WorldtaskAcceptReq)
|
|||||||
a.module.ModuleBuried.ActiveCondition(uid, curTaskConf.Completetask...)
|
a.module.ModuleBuried.ActiveCondition(uid, curTaskConf.Completetask...)
|
||||||
|
|
||||||
//判断是否要结束任务
|
//判断是否要结束任务
|
||||||
if ((len(curTaskConf.Completetask) == 1 && curTaskConf.Completetask[0] == 0) || len(curTaskConf.Completetask) == 0) &&
|
if ((len(curTaskConf.Completetask) >= 1 && curTaskConf.Completetask[0] == 0) || len(curTaskConf.Completetask) == 0) &&
|
||||||
curTaskConf.DeliverNpc == 0 {
|
curTaskConf.DeliverNpc == 0 {
|
||||||
a.sendMsg(session, WorldtaskSubtypeAccept, rsp)
|
a.sendMsg(session, WorldtaskSubtypeAccept, rsp)
|
||||||
//结束任务
|
//结束任务
|
||||||
|
@ -34,7 +34,7 @@ func (this *apiComp) CompleteCondi(session comm.IUserSession, req *pb.WorldtaskC
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (len(curTaskConf.Completetask) == 1 && curTaskConf.Completetask[0] == 0) ||
|
if (len(curTaskConf.Completetask) >= 1 && curTaskConf.Completetask[0] == 0) ||
|
||||||
len(curTaskConf.Completetask) == 0 {
|
len(curTaskConf.Completetask) == 0 {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_WorldtaskNoProcess,
|
Code: pb.ErrorCode_WorldtaskNoProcess,
|
||||||
|
@ -59,7 +59,7 @@ func (this *apiComp) Mine(session comm.IUserSession, req *pb.WorldtaskMineReq) (
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (len(cfg.Completetask) == 1 && cfg.Completetask[0] > 0) &&
|
if (len(cfg.Completetask) >= 1 && cfg.Completetask[0] > 0) &&
|
||||||
len(cfg.Completetask) > 0 {
|
len(cfg.Completetask) > 0 {
|
||||||
condIds = append(condIds, cfg.Completetask...)
|
condIds = append(condIds, cfg.Completetask...)
|
||||||
condMap[k] = cfg.Completetask
|
condMap[k] = cfg.Completetask
|
||||||
|
@ -155,8 +155,6 @@ func (this *Worldtask) TCondFinishNotify(uid string, conds []*pb.ConIProgress) {
|
|||||||
var currentTasks []*pb.CurrentTask
|
var currentTasks []*pb.CurrentTask
|
||||||
for _, tasks := range taskConds {
|
for _, tasks := range taskConds {
|
||||||
for _, t := range tasks {
|
for _, t := range tasks {
|
||||||
// for _, cond := range t.Conds {
|
|
||||||
// if cond.State == pb.BuriedItemFinishState_buried_finish {
|
|
||||||
curTaskConf, err := this.configure.getWorldtaskById(t.TaskId)
|
curTaskConf, err := this.configure.getWorldtaskById(t.TaskId)
|
||||||
if err != nil || curTaskConf == nil {
|
if err != nil || curTaskConf == nil {
|
||||||
return
|
return
|
||||||
@ -166,8 +164,6 @@ func (this *Worldtask) TCondFinishNotify(uid string, conds []*pb.ConIProgress) {
|
|||||||
this.modelWorldtask.taskFinishPush(session, userTask, curTaskConf)
|
this.modelWorldtask.taskFinishPush(session, userTask, curTaskConf)
|
||||||
}
|
}
|
||||||
currentTasks = append(currentTasks, t)
|
currentTasks = append(currentTasks, t)
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -398,7 +394,7 @@ func (this *Worldtask) GetWorldTaskBy(session comm.IUserSession, groupId int32)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//判断是否要结束任务
|
//判断是否要结束任务
|
||||||
if ((len(curTaskConf.Completetask) == 1 && curTaskConf.Completetask[0] == 0) ||
|
if ((len(curTaskConf.Completetask) >= 1 && curTaskConf.Completetask[0] == 0) ||
|
||||||
len(curTaskConf.Completetask) == 0) &&
|
len(curTaskConf.Completetask) == 0) &&
|
||||||
curTaskConf.DeliverNpc == 0 {
|
curTaskConf.DeliverNpc == 0 {
|
||||||
//结束任务
|
//结束任务
|
||||||
|
Loading…
Reference in New Issue
Block a user