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