Commit 9d65fc1d94a48da3b8dd94566bbd7d3cba99f91b

Authored by 陆恒
1 parent b5595dac

提交

Showing 1 changed file with 3 additions and 1 deletions   Show diff stats
src/HttpServer/logic/function.go
... ... @@ -339,7 +339,9 @@ func (uinfo *UserData) HandleGetTaskReward(req *GettaskrewardReq, resp *Gettaskr
339 339  
340 340 //状态对的情况 如果是成就下需要判断前置条件是否被
341 341 if req.Tasktype == 2 && index > 0 {
342   - if list.Taskdata[index-1].Taskstatus != 0 {
  342 + precfg := GetTaskConfig(list.Taskdata[index-1].Taskid)
  343 + nowcfg := GetTaskConfig(taskdesc.Taskid)
  344 + if precfg != nil && nowcfg != nil && precfg.TaskType == nowcfg.TaskType && list.Taskdata[index-1].Taskstatus != 0 {
343 345 resp.Code = ERROR_TASKPRE_NOTGET
344 346 resp.Message = "前置任务还未领取"
345 347 return errors.New("当前任务未完成或已领取")
... ...