From c81e76b1d69ebc0f949c7d56afba8ed88f412578 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Sat, 23 Jul 2022 00:29:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8B=B1=E9=9B=84=E5=8F=A0=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hero/module.go | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/modules/hero/module.go b/modules/hero/module.go index d10f07b38..d6dbcf3f0 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -171,15 +171,6 @@ func (this *Hero) AddCardExp(uid string, heroId string, exp int32) (newhero *pb. if _hero.SameCount == 0 { this.modelHero.consumeHeroCard(uid, _hero.Id, 1) } - // else { - // update := map[string]interface{}{ - // "sameCount": _hero.SameCount, - // } - // if err := this.modelHero.modifyHeroData(uid, heroId, update); err != nil { - // code = pb.ErrorCode_DBError - // } // 修改英雄数据 - // } - // 新增英雄 update1 := map[string]interface{}{ "lv": curLv, "exp": curExp, @@ -198,10 +189,10 @@ func (this *Hero) AddCardExp(uid string, heroId string, exp int32) (newhero *pb. update := map[string]interface{}{ "sameCount": curCount, } - if err := this.modelHero.modifyHeroData(uid, _hero.Id, update); err != nil { + if err := this.modelHero.modifyHeroData(uid, _hero.Id, update1); err != nil { code = pb.ErrorCode_DBError } - if err := this.modelHero.modifyHeroData(uid, newhero.Id, update1); err != nil { + if err := this.modelHero.modifyHeroData(uid, newhero.Id, update); err != nil { code = pb.ErrorCode_DBError } oldhero = _hero