From 57bf9204c10150e8164ce66f00486b58c9841932 Mon Sep 17 00:00:00 2001 From: chenxi Date: Thu, 11 May 2023 21:33:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/userdata/task/daily_task_data.lua | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) 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