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