Commit 9991263083fc8b9f68ffe6c40bf246853299e94e
1 parent
37ad731e
fix rune
Showing
4 changed files
with
10 additions
and
10 deletions
Show diff stats
src/actions/HeroAction.lua
... | ... | @@ -515,7 +515,8 @@ function _M.referEquipsRpc(agent, data) |
515 | 515 | role:addEquip({type=typ,level=ownLv,count=1,isRefer=true}) |
516 | 516 | end |
517 | 517 | end |
518 | - hero:updateProperty({field = "equip", value = hero:getProperty("equip"):setv(typ, level)}) | |
518 | + local x = hero:getProperty("equip"):setv(typ, level) | |
519 | + hero:updateProperty({field = "equip", value = x}) | |
519 | 520 | end |
520 | 521 | SendPacket(actionCodes.Hero_referEquipsRpc, "") |
521 | 522 | return true |
... | ... | @@ -559,7 +560,8 @@ function _M.referRunesRpc(agent, data) |
559 | 560 | local ownRune = role.runeBag[uid] |
560 | 561 | ownRune:updateProperty({field = "refer",value = hero:getProperty("id")}) |
561 | 562 | end |
562 | - hero:updateProperty({field = "rune", value = hero:getProperty("rune"):setv(typ,uid)}) | |
563 | + local x = hero:getProperty("rune"):setv(typ,uid) | |
564 | + hero:updateProperty({field = "rune", value = x}) | |
563 | 565 | end |
564 | 566 | SendPacket(actionCodes.Hero_referRunesRpc, "") |
565 | 567 | return true | ... | ... |
src/actions/RoleAction.lua
... | ... | @@ -154,18 +154,17 @@ function _M.loginRpc( agent, data ) |
154 | 154 | SendPacket(actionCodes.Role_loginRpc, MsgPack.pack(response)) |
155 | 155 | |
156 | 156 | local equipResp = {equipBag = {}} |
157 | - for _,set in pairs(role.equipBag) do | |
158 | - for _,equip in pairs(set) do | |
159 | - local data = equip:data() | |
160 | - if not equipResp.equipBag[data.type] then equipResp.equipBag[data.type] = {} end | |
161 | - equipResp.equipBag[data.type][data.level] = data | |
157 | + for typ,set in pairs(role.equipBag) do | |
158 | + for level,equip in pairs(set) do | |
159 | + if not equipResp.equipBag[typ] then equipResp.equipBag[typ] = {} end | |
160 | + equipResp.equipBag[typ][level] = equip:data() | |
162 | 161 | end |
163 | 162 | end |
164 | 163 | SendPacket(actionCodes.Role_loginRpc, MsgPack.pack(equipResp)) |
165 | 164 | |
166 | 165 | local runeResp = {runeBag = {}} |
167 | 166 | for _,rune in pairs(role.runeBag) do |
168 | - table_insert(runeResp.runeBag, rune:data()) | |
167 | + runeResp.runeBag[rune:getProperty("uid")]=rune:data() | |
169 | 168 | end |
170 | 169 | SendPacket(actionCodes.Role_loginRpc, MsgPack.pack(runeResp)) |
171 | 170 | ... | ... |
src/models/Hero.lua