From d8ca98f2e2d93aea54470c23b9772a66637d999a Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 21 Jul 2023 22:29:38 +0800 Subject: [PATCH] =?UTF-8?q?map=20=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hero/api_drawCard.go | 6 ++++++ modules/hero/model_record.go | 2 ++ 2 files changed, 8 insertions(+) diff --git a/modules/hero/api_drawCard.go b/modules/hero/api_drawCard.go index bbad631a7..1da3acf8b 100644 --- a/modules/hero/api_drawCard.go +++ b/modules/hero/api_drawCard.go @@ -52,6 +52,12 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq if heroRecord.Count == nil { heroRecord.Count = make(map[int32]int32) } + if heroRecord.Wish == nil { + heroRecord.Wish = make(map[string]int64) + } + if heroRecord.Limit == nil { + heroRecord.Limit = make(map[string]int64) + } rsp := &pb.HeroDrawCardResp{ Data: []*pb.AtnoData{}, Wish: &pb.UserAtno{}, diff --git a/modules/hero/model_record.go b/modules/hero/model_record.go index 4cb4aa237..268ca38bd 100644 --- a/modules/hero/model_record.go +++ b/modules/hero/model_record.go @@ -40,6 +40,8 @@ func (this *ModelRecord) GetHeroRecord(uid string) (result *pb.DBHeroRecord, err result.Baodi5 = map[int32]int32{} result.Count = map[int32]int32{} result.Peach = map[int32]bool{} + result.Wish = map[string]int64{} + result.Limit = map[string]int64{} result.Mtime = configure.Now().Unix() this.Add(uid, result) err = nil