Commit 3dbe0d5d42d22c3b8b7443c381ed9a9798cc32ca
1 parent
7bc5b662
#fxtr_10186 修复两个bug
Showing
2 changed files
with
3 additions
and
3 deletions
 
Show diff stats
src/models/HeroPlugin.lua
| @@ -232,8 +232,8 @@ function HeroPlugin.bind(Hero) | @@ -232,8 +232,8 @@ function HeroPlugin.bind(Hero) | ||
| 232 | for _, attName in pairs(AttsEnumEx) do | 232 | for _, attName in pairs(AttsEnumEx) do | 
| 233 | attrs[attName] = 0 | 233 | attrs[attName] = 0 | 
| 234 | end | 234 | end | 
| 235 | - for _, data in pairs(self.spark or {}) do | ||
| 236 | - for k, v in pairs(data.attrs:toNumMap()) do | 235 | + for _, data in pairs(self:getProperty("spark") or {}) do | 
| 236 | + for k, v in pairs(data.attrs) do | ||
| 237 | attrs[AttsEnumEx[k]] = attrs[AttsEnumEx[k]] + v | 237 | attrs[AttsEnumEx[k]] = attrs[AttsEnumEx[k]] + v | 
| 238 | end | 238 | end | 
| 239 | end | 239 | end | 
src/shared/ModelBase.lua
| @@ -178,7 +178,7 @@ function ModelBase:loadProperties(properties) | @@ -178,7 +178,7 @@ function ModelBase:loadProperties(properties) | ||
| 178 | properties[field] = MsgPack.unpack(properties[field]) | 178 | properties[field] = MsgPack.unpack(properties[field]) | 
| 179 | end | 179 | end | 
| 180 | 180 | ||
| 181 | - local val = properties[field] or def | 181 | + local val = properties[field] or clone(def) | 
| 182 | if val ~= nil then | 182 | if val ~= nil then | 
| 183 | if typ == "number" then val = tonumber(val) end | 183 | if typ == "number" then val = tonumber(val) end | 
| 184 | assert(type(val) == typ, | 184 | assert(type(val) == typ, |