Commit 5224937417f8ef2f39a173ce802b8d2a6295cb3b

Authored by liuzujun
1 parent a12bfcce

添加铭文表

Showing 2 changed files with 6 additions and 10 deletions   Show diff stats
src/models/RolePlugin.lua
... ... @@ -616,7 +616,7 @@ function RolePlugin.bind(Role)
616 616 local hero = require("models.Hero").new({key = string.format("%d",data.id), id=data.id})
617 617 if hero:load(data) then
618 618 hero.owner = self
619   - self.heros[hero:getSimpleRuneId()] = hero
  619 + self.heros[hero:getSimpleHeroId()] = hero
620 620 end
621 621 end
622 622 end
... ... @@ -743,10 +743,10 @@ function RolePlugin.bind(Role)
743 743 local roleId = self:getProperty("id")
744 744 local res = mysqlproxy:query(string.format("SELECT * FROM `Rune` WHERE `roleid` = %s", roleId))
745 745 for _, data in ipairs(res) do
746   - local rune = require("models.Rune").new({key = string.format("%d",data.id), id=data.id})
747   - if hero:load(data) then
748   - hero.owner = self
749   - self.runeBag[rune:getSimpleRuneId()] = rune
  746 + local rune = require("models.Rune").new({key = string.format("%d",data.uid), uid=data.uid})
  747 + if rune:load(data) then
  748 + rune.owner = self
  749 + self.runeBag[data.uid] = rune
750 750 end
751 751 end
752 752 end
... ...
src/models/Rune.lua
... ... @@ -13,10 +13,6 @@ function Rune:ctor( properties )
13 13 Rune.super.ctor(self, properties)
14 14 end
15 15  
16   -function Rune:getSimpleRuneId()
17   - return self:getProperty("uid") % (self:getProperty("roleid") * MAX_RUNE_NUM)
18   -end
19   -
20 16 function Rune:notifyUpdateProperty(field, newValue, oldValue)
21 17 local datas = {
22 18 uid = self:getProperty("uid"),
... ... @@ -45,7 +41,7 @@ end
45 41  
46 42 function Rune:notifyUpdateProperties(params)
47 43 local updateData = {
48   - uid = self:getSimpleRuneId(),
  44 + uid = self:getProperty("uid"),
49 45 datas = params
50 46 }
51 47 SendPacket(actionCodes.Role_updateRune, MsgPack.pack(updateData))
... ...