Commit 81fb807905925e1dc350fbe74e04e91a937c4c6c
Merge branch 'tr/develop' into tr/bugfix
Showing
1 changed file
with
6 additions
and
1 deletions
Show diff stats
src/actions/SeaportAction.lua
@@ -139,6 +139,7 @@ function _M.taskRpc(agent, data) | @@ -139,6 +139,7 @@ function _M.taskRpc(agent, data) | ||
139 | if not TaskCsv[taskId] or not TaskCsv[taskId][level] then return 1 end | 139 | if not TaskCsv[taskId] or not TaskCsv[taskId][level] then return 1 end |
140 | 140 | ||
141 | local reward, change = {}, {} | 141 | local reward, change = {}, {} |
142 | + local heroFaithMap = {} | ||
142 | local seaport = role:getProperty("seaport") | 143 | local seaport = role:getProperty("seaport") |
143 | 144 | ||
144 | local data = TaskCsv[taskId][level] | 145 | local data = TaskCsv[taskId][level] |
@@ -211,6 +212,7 @@ function _M.taskRpc(agent, data) | @@ -211,6 +212,7 @@ function _M.taskRpc(agent, data) | ||
211 | if hero then | 212 | if hero then |
212 | totalCoef = totalCoef + getHeroCoef(hero, data.success) | 213 | totalCoef = totalCoef + getHeroCoef(hero, data.success) |
213 | hero:addHeroFaith(data.trust) | 214 | hero:addHeroFaith(data.trust) |
215 | + heroFaithMap[heroId] = hero:getProperty("faith") | ||
214 | end | 216 | end |
215 | end | 217 | end |
216 | 218 | ||
@@ -241,7 +243,10 @@ function _M.taskRpc(agent, data) | @@ -241,7 +243,10 @@ function _M.taskRpc(agent, data) | ||
241 | 243 | ||
242 | role:updateProperty({field = "seaport", value = seaport}) | 244 | role:updateProperty({field = "seaport", value = seaport}) |
243 | 245 | ||
244 | - SendPacket(actionCodes.Seaport_taskRpc, MsgPack.pack(role:packReward(reward, change))) | 246 | + local result = role:packReward(reward, change) |
247 | + result["heroFaith"] = heroFaithMap | ||
248 | + | ||
249 | + SendPacket(actionCodes.Seaport_taskRpc, MsgPack.pack(result)) | ||
245 | return true | 250 | return true |
246 | end | 251 | end |
247 | 252 |