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 55 for n = 1, 6 do
56 56 local index = math.randWeight(taskPool, "chance")
57 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 59 table.remove(taskPool, index)
60 60 end
61 61 end
... ... @@ -94,11 +94,11 @@ end
94 94 function Diner:checkDinerTask(type, count, param1, param2, notNotify)
95 95 local orders = json.decode(self:getProperty("order"))
96 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 102 data.n = data.n + count
103 103 dirty = true
104 104 end
... ...