From 0cca9748b1cdbf57e4655c04b8c86581daf38370 Mon Sep 17 00:00:00 2001 From: zhengshouren <448949750@qq.com> Date: Fri, 24 May 2019 17:20:30 +0800 Subject: [PATCH] 任务增加锁定状态,只有锁定状态的任务才能计数 --- src/models/Diner.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/models/Diner.lua b/src/models/Diner.lua index d3e27e4..5b7eb5b 100644 --- a/src/models/Diner.lua +++ b/src/models/Diner.lua @@ -55,7 +55,7 @@ function Diner:refreshDailyData(notify) for n = 1, 6 do local index = math.randWeight(taskPool, "chance") local data = taskPool[index] - table.insert(orders, {lv = taskLevel, id = data.id, n = 0}) + table.insert(orders, {lv = taskLevel, id = data.id, n = 0, lock = 0}) table.remove(taskPool, index) end end @@ -94,11 +94,11 @@ end function Diner:checkDinerTask(type, count, param1, param2, notNotify) local orders = json.decode(self:getProperty("order")) local dirty = false - for _, data in ipairs(orders) do - local taskSet = csvdb["diner_questCsv"][data.lv] - if taskSet and taskSet[data.id] then - local task = taskSet[data.id] - if task.type == type and task.condition1 == param1 then + for _, task in ipairs(orders) do + local taskSet = csvdb["diner_questCsv"][task.lv] + if taskSet and taskSet[task.id] then + local data = taskSet[task.id] + if data.type == type and data.condition1 == param1 and task.lock > 0 then data.n = data.n + count dirty = true end -- libgit2 0.21.2