From c047d94f9b3c650ea88fd3d9b17d0e05abc24cfa Mon Sep 17 00:00:00 2001 From: zqj <582132116@qq.com> Date: Fri, 6 May 2022 14:09:58 +0800 Subject: [PATCH] fix: update equipment --- models/role.go | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/models/role.go b/models/role.go index a1aac65..759d826 100644 --- a/models/role.go +++ b/models/role.go @@ -32,12 +32,13 @@ func RoleExistByUid(uid string) *RoleModel { } r := &RoleModel{ - ISchema: NewSchema(data.Id, data), - Role: data, - Heros: make(SchemaMap), - Teams: make(SchemaMap), - Prop: new(PropModel), - Items: make(common.IMapString), + ISchema: NewSchema(data.Id, data), + Role: data, + Heros: make(SchemaMap), + Teams: make(SchemaMap), + Equipments: make(SchemaMap), + Prop: new(PropModel), + Items: make(common.IMapString), } r.Load() r.LoadAll() @@ -47,12 +48,13 @@ func RoleExistByUid(uid string) *RoleModel { func NewRole(id string) *RoleModel { data := &pb.Role{Id: id, Incres: make(map[string]uint32)} m := &RoleModel{ - ISchema: NewSchema(id, data), - Role: data, - Heros: make(SchemaMap), - Teams: make(SchemaMap), - Prop: new(PropModel), - Items: make(common.IMapString), + ISchema: NewSchema(id, data), + Role: data, + Heros: make(SchemaMap), + Teams: make(SchemaMap), + Equipments: make(SchemaMap), + Prop: new(PropModel), + Items: make(common.IMapString), } return m } @@ -258,7 +260,7 @@ func (m *RoleModel) SaveRoleData(now int64) { } } - mpObjs := []SchemaMap{m.Heros, m.Teams} + mpObjs := []SchemaMap{m.Heros, m.Teams, m.Equipments} for _, mpObj := range mpObjs { for _, v := range mpObj { if v != nil { -- libgit2 0.21.2