Commit ad88ba140348dbd4e9d5873bd897a18ff8c3381d
1 parent
bab30666
工坊 bug
Showing
3 changed files
with
6 additions
and
4 deletions
Show diff stats
src/actions/AdvAction.lua
@@ -337,7 +337,7 @@ function _M.workshopRpc(agent, data) | @@ -337,7 +337,7 @@ function _M.workshopRpc(agent, data) | ||
337 | 337 | ||
338 | role:costItems(cost) | 338 | role:costItems(cost) |
339 | advWs[id] = (advWs[id] or 0) + count | 339 | advWs[id] = (advWs[id] or 0) + count |
340 | - role.dailyData:updateProperty({field = advWs, value = advWs}) | 340 | + role.dailyData:updateProperty({field = "advWs", value = advWs}) |
341 | local reward = role:award({[id] = count}) | 341 | local reward = role:award({[id] = count}) |
342 | SendPacket(actionCodes.Adv_workshopRpc, MsgPack.pack({reward = reward})) | 342 | SendPacket(actionCodes.Adv_workshopRpc, MsgPack.pack({reward = reward})) |
343 | return true | 343 | return true |
src/adv/AdvTask.lua
@@ -60,6 +60,7 @@ function AdvTask.bind(Adv) | @@ -60,6 +60,7 @@ function AdvTask.bind(Adv) | ||
60 | 60 | ||
61 | function Adv:initLayerTask() | 61 | function Adv:initLayerTask() |
62 | self.advTask = {} | 62 | self.advTask = {} |
63 | + self.advTaskChange = true | ||
63 | if not next(self.advMTask) then | 64 | if not next(self.advMTask) then |
64 | self.advMTask = { | 65 | self.advMTask = { |
65 | id = 1, | 66 | id = 1, |
src/models/RolePlugin.lua
@@ -97,7 +97,7 @@ function RolePlugin.bind(Role) | @@ -97,7 +97,7 @@ function RolePlugin.bind(Role) | ||
97 | count = 0 | 97 | count = 0 |
98 | end, | 98 | end, |
99 | [ItemType.FuncOpen] = function() | 99 | [ItemType.FuncOpen] = function() |
100 | - self:funcOpen(itemId) | 100 | + self:funcOpen(itemId, count) |
101 | end, | 101 | end, |
102 | } | 102 | } |
103 | -- 对数量筛查 | 103 | -- 对数量筛查 |
@@ -597,7 +597,8 @@ function RolePlugin.bind(Role) | @@ -597,7 +597,8 @@ function RolePlugin.bind(Role) | ||
597 | return self:getProperty("funcLv")[func] or 1 | 597 | return self:getProperty("funcLv")[func] or 1 |
598 | end | 598 | end |
599 | 599 | ||
600 | - function Role:funcOpen(func) | 600 | + function Role:funcOpen(func, count) |
601 | + count = count or 1 | ||
601 | if csvdb["itemCsv"][func] and csvdb["itemCsv"][func].type == ItemType.FuncOpen then | 602 | if csvdb["itemCsv"][func] and csvdb["itemCsv"][func].type == ItemType.FuncOpen then |
602 | local unlockData = csvdb["unlockCsv"][func] | 603 | local unlockData = csvdb["unlockCsv"][func] |
603 | if TypeIsFunc[unlockData.type] then | 604 | if TypeIsFunc[unlockData.type] then |
@@ -605,7 +606,7 @@ function RolePlugin.bind(Role) | @@ -605,7 +606,7 @@ function RolePlugin.bind(Role) | ||
605 | self:changeUpdates({{type = "funcOpen", field = unlockData.type, value = 1}}) | 606 | self:changeUpdates({{type = "funcOpen", field = unlockData.type, value = 1}}) |
606 | else | 607 | else |
607 | local oldV = self:getFuncLv(unlockData.type) | 608 | local oldV = self:getFuncLv(unlockData.type) |
608 | - self:changeUpdates({{type = "funcLv", field = unlockData.type, value = oldV + 1}}) | 609 | + self:changeUpdates({{type = "funcLv", field = unlockData.type, value = oldV + count}}) |
609 | end | 610 | end |
610 | else | 611 | else |
611 | self:changeUpdates({{type = "funcOpen", field = func, value = 1}}) | 612 | self:changeUpdates({{type = "funcOpen", field = func, value = 1}}) |