From 8b6110246bd76384606933a65cfc85b134e23509 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 3 Mar 2023 10:50:59 +0800 Subject: [PATCH] update --- modules/hero/module.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/hero/module.go b/modules/hero/module.go index 437c9b740..aa7667602 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -322,10 +322,12 @@ func (this *Hero) KungFuHero(session comm.IUserSession, heroObjID string, bKongf var ( _hero *pb.DBHero _changeHero []*pb.DBHero // 变化的英雄 + model *db.DBModel // 跨服对象 + err error ) if this.IsCross() { - if model, err := this.GetDBModuleByUid(session.GetUserId(), this.modelHero.TableName, this.modelHero.Expired); err == nil { + if model, err = this.GetDBModuleByUid(session.GetUserId(), this.modelHero.TableName, this.modelHero.Expired); err == nil { if err := model.GetListObj(session.GetUserId(), heroObjID, _hero); err != nil { this.Errorf("err:%v", err) return @@ -357,7 +359,7 @@ func (this *Hero) KungFuHero(session comm.IUserSession, heroObjID string, bKongf } if this.IsCross() { - if model, err := this.GetDBModuleByUid(session.GetUserId(), this.modelHero.TableName, this.modelHero.Expired); err == nil { + if model != nil { if err := model.ChangeList(session.GetUserId(), heroObjID, _heroMap); err != nil { this.Errorf("err:%v", err) code = pb.ErrorCode_DBError