diff --git a/src/actions/DinerAction.lua b/src/actions/DinerAction.lua index dd55b7a..c8a58ce 100644 --- a/src/actions/DinerAction.lua +++ b/src/actions/DinerAction.lua @@ -565,8 +565,17 @@ function _M.refreshTaskRpc( agent, data ) end local pool = {} + + local dishTree = role.dinerData:getProperty("dishTree") for id, temp in pairs(taskData) do - if not hadTask[id] then + local unlock = true + for _, front in ipairs(temp.front:toArray(true, "=")) do + if dishTree:getv(front, 0) == 0 then + unlock = false + break + end + end + if not hadTask[id] and unlock then table.insert(pool, temp) end end diff --git a/src/models/Diner.lua b/src/models/Diner.lua index e4aa768..5586156 100644 --- a/src/models/Diner.lua +++ b/src/models/Diner.lua @@ -92,8 +92,16 @@ function Diner:refreshDailyData(notify) local taskData = csvdb["diner_questCsv"][taskLevel] if not taskData then return end local pool = {} + local dishTree = self:getProperty("dishTree") for id, temp in pairs(taskData) do - if not hadTask[id] then + local unlock = true + for _, front in ipairs(temp.front:toArray(true, "=")) do + if dishTree:getv(front, 0) == 0 then + unlock = false + break + end + end + if not hadTask[id] and unlock then table.insert(pool, temp) end end -- libgit2 0.21.2