Skip to content

Commit

Permalink
属性系统支持复合属性
Browse files Browse the repository at this point in the history
  • Loading branch information
xiyoo0812 committed May 30, 2024
1 parent 89c62c0 commit baa5dbd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions server/business/component/attr_component.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,23 @@ function AttrComponent:bind_attr(attr_id, attr, service_name)
oattr_info.services[service_name] = true
return
end
local attr_opt = attr_db.find_one(attr_id)
local attr_opt = attr_db:find_one(attr_id)
if attr_opt.complex then
for idx, info in ipairs(COMPLEX_NAMES) do
--复合子属性不同步
local complex_id = COMPLEX_ID + attr_id * 4 + idx
local complex_info = { save = info[2], type = info[3], range = 0, share = attr.share, services = {}, base = attr_id }
self:init_attr(attr_opt.attr_type, complex_id , complex_info)
self:init_attr(attr_opt.type, complex_id , complex_info)
end
--复合属性不共享,不存储
local attr_info = { save = false, share = false, range = attr.range, type = attr_opt.attr_type, services = {} }
self:init_attr(attr_opt.attr_type, attr_id, attr_info)
local attr_info = { save = false, share = false, range = attr.range, type = attr_opt.type, services = {} }
self:init_attr(attr_opt.type, attr_id, attr_info)
else
local attr_info = { save = attr.save, share = attr.share, range = attr.range, type = attr_opt.attr_type, services = {} }
local attr_info = { save = attr.save, share = attr.share, range = attr.range, type = attr_opt.type, services = {} }
if attr_opt.limit then
attr_info.limit_id = qenum("AttrID", attr_opt.limit)
end
self:init_attr(attr_opt.attr_type, attr_id, attr_info)
self:init_attr(attr_opt.type, attr_id, attr_info)
end
end

Expand Down

0 comments on commit baa5dbd

Please sign in to comment.