diff --git a/lua/app/userdata/task/daily_task_data.lua b/lua/app/userdata/task/daily_task_data.lua index 9a114a18..3bba04a0 100644 --- a/lua/app/userdata/task/daily_task_data.lua +++ b/lua/app/userdata/task/daily_task_data.lua @@ -38,17 +38,18 @@ function DailyTaskData:init(data) } if v.bounty then dailyTaskObj.lock = true + else -- 只有解锁的任务才注册监听任务进度 + local list = self.taskTypeMap[taskInfo.type] + if list == nil then + list = {} + self.taskTypeMap[taskInfo.type] = list + end + table.insert(list, dailyTaskObj) + if #list == 1 then + self:registerTask(taskInfo.type) + end end self.dailyTasks[k] = dailyTaskObj - local list = self.taskTypeMap[taskInfo.type] - if list == nil then - list = {} - self.taskTypeMap[taskInfo.type] = list - end - table.insert(list, dailyTaskObj) - if #list == 1 then - self:registerTask(taskInfo.type) - end end end end