diff --git a/comm/imodule.go b/comm/imodule.go index 08e4cf811..a1160f467 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -91,7 +91,7 @@ type ( QueryHeroByConfId(uId string, heroCfgId string) (hero *pb.DBHero) // 批量创建英雄 - CreateRepeatHeros(session IUserSession, heros map[string]int32, bPush bool) (hero *pb.DBHero, atno []*pb.UserAtno, errdata *pb.ErrorData) + CreateRepeatHeros(session IUserSession, heros map[string]int32, bPush bool) (atno []*pb.UserAtno, errdata *pb.ErrorData) // 获取英雄 // heroId 英雄ID GetHeroByObjID(uid, heroId string) (hero *pb.DBHero, errdata *pb.ErrorData) diff --git a/modules/hero/module.go b/modules/hero/module.go index 13f9716c8..ac67d00f8 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -273,11 +273,12 @@ func (this *Hero) EventUserOffline(uid, sessionid string) { } // 批量创建多个英雄 -func (this *Hero) CreateRepeatHeros(session comm.IUserSession, heros map[string]int32, bPush bool) (hero *pb.DBHero, atno []*pb.UserAtno, errdata *pb.ErrorData) { +func (this *Hero) CreateRepeatHeros(session comm.IUserSession, heros map[string]int32, bPush bool) (atno []*pb.UserAtno, errdata *pb.ErrorData) { var ( changeList []*pb.DBHero firstGet []string bFirst bool + hero *pb.DBHero ) for heroCfgId, num := range heros { if num == 0 { // 数量为0 不做处理 diff --git a/modules/modulebase.go b/modules/modulebase.go index 28506fee9..04142a3f9 100644 --- a/modules/modulebase.go +++ b/modules/modulebase.go @@ -486,7 +486,7 @@ func (this *ModuleBase) DispenseRes(session comm.IUserSession, res []*cfg.Gameat this.Debugf("发放道具资源: %v errdata: %v", items, errdata) } if len(heros) > 0 { //卡片资源 - _, _, errdata = this.ModuleHero.CreateRepeatHeros(session, heros, bPush) + _, errdata = this.ModuleHero.CreateRepeatHeros(session, heros, bPush) this.Debugf("发放英雄资源: %v errdata: %v", heros, errdata) } if len(equips) > 0 { @@ -718,7 +718,7 @@ func (this *ModuleBase) DispenseAtno(session comm.IUserSession, res []*cfg.Gamea this.Debugf("发放道具资源: %v errdata: %v", items, errdata) } if len(heros) > 0 { //卡片资源 - if _, heroschange, errdata = this.ModuleHero.CreateRepeatHeros(session, heros, bPush); errdata != nil { + if heroschange, errdata = this.ModuleHero.CreateRepeatHeros(session, heros, bPush); errdata != nil { return } atno = append(atno, heroschange...)