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