Commit 0cca9748b1cdbf57e4655c04b8c86581daf38370

Authored by zhengshouren
1 parent f5c07b1b

任务增加锁定状态,只有锁定状态的任务才能计数

Showing 1 changed file with 6 additions and 6 deletions   Show diff stats
src/models/Diner.lua
@@ -55,7 +55,7 @@ function Diner:refreshDailyData(notify) @@ -55,7 +55,7 @@ function Diner:refreshDailyData(notify)
55 for n = 1, 6 do 55 for n = 1, 6 do
56 local index = math.randWeight(taskPool, "chance") 56 local index = math.randWeight(taskPool, "chance")
57 local data = taskPool[index] 57 local data = taskPool[index]
58 - table.insert(orders, {lv = taskLevel, id = data.id, n = 0}) 58 + table.insert(orders, {lv = taskLevel, id = data.id, n = 0, lock = 0})
59 table.remove(taskPool, index) 59 table.remove(taskPool, index)
60 end 60 end
61 end 61 end
@@ -94,11 +94,11 @@ end @@ -94,11 +94,11 @@ end
94 function Diner:checkDinerTask(type, count, param1, param2, notNotify) 94 function Diner:checkDinerTask(type, count, param1, param2, notNotify)
95 local orders = json.decode(self:getProperty("order")) 95 local orders = json.decode(self:getProperty("order"))
96 local dirty = false 96 local dirty = false
97 - for _, data in ipairs(orders) do  
98 - local taskSet = csvdb["diner_questCsv"][data.lv]  
99 - if taskSet and taskSet[data.id] then  
100 - local task = taskSet[data.id]  
101 - if task.type == type and task.condition1 == param1 then 97 + for _, task in ipairs(orders) do
  98 + local taskSet = csvdb["diner_questCsv"][task.lv]
  99 + if taskSet and taskSet[task.id] then
  100 + local data = taskSet[task.id]
  101 + if data.type == type and data.condition1 == param1 and task.lock > 0 then
102 data.n = data.n + count 102 data.n = data.n + count
103 dirty = true 103 dirty = true
104 end 104 end