From f595e78333a59c35dfe2c6a6763e001598766c17 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 17 Aug 2023 09:33:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8B=B1=E9=9B=84=E6=8E=A5=E5=8F=A3=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 2 +- modules/hero/module.go | 3 ++- modules/modulebase.go | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) 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...)