Commit f4bbb20842c1cf202874f5665a4c1f7e3780a135
1 parent
0889982f
餐厅任务解锁
Showing
2 changed files
with
19 additions
and
2 deletions
Show diff stats
src/actions/DinerAction.lua
| ... | ... | @@ -565,8 +565,17 @@ function _M.refreshTaskRpc( agent, data ) |
| 565 | 565 | end |
| 566 | 566 | |
| 567 | 567 | local pool = {} |
| 568 | + | |
| 569 | + local dishTree = role.dinerData:getProperty("dishTree") | |
| 568 | 570 | for id, temp in pairs(taskData) do |
| 569 | - if not hadTask[id] then | |
| 571 | + local unlock = true | |
| 572 | + for _, front in ipairs(temp.front:toArray(true, "=")) do | |
| 573 | + if dishTree:getv(front, 0) == 0 then | |
| 574 | + unlock = false | |
| 575 | + break | |
| 576 | + end | |
| 577 | + end | |
| 578 | + if not hadTask[id] and unlock then | |
| 570 | 579 | table.insert(pool, temp) |
| 571 | 580 | end |
| 572 | 581 | end | ... | ... |
src/models/Diner.lua
| ... | ... | @@ -92,8 +92,16 @@ function Diner:refreshDailyData(notify) |
| 92 | 92 | local taskData = csvdb["diner_questCsv"][taskLevel] |
| 93 | 93 | if not taskData then return end |
| 94 | 94 | local pool = {} |
| 95 | + local dishTree = self:getProperty("dishTree") | |
| 95 | 96 | for id, temp in pairs(taskData) do |
| 96 | - if not hadTask[id] then | |
| 97 | + local unlock = true | |
| 98 | + for _, front in ipairs(temp.front:toArray(true, "=")) do | |
| 99 | + if dishTree:getv(front, 0) == 0 then | |
| 100 | + unlock = false | |
| 101 | + break | |
| 102 | + end | |
| 103 | + end | |
| 104 | + if not hadTask[id] and unlock then | |
| 97 | 105 | table.insert(pool, temp) |
| 98 | 106 | end |
| 99 | 107 | end | ... | ... |