diff --git a/modules/hero/api_resonance.go b/modules/hero/api_resonance.go index 5bee9151d..be2401391 100644 --- a/modules/hero/api_resonance.go +++ b/modules/hero/api_resonance.go @@ -61,7 +61,7 @@ func (this *apiComp) ResonanceCheck(session comm.IUserSession, req *pb.HeroReson // 金币校验 for _, v := range resonConfig.Need { if v.A == "attr" { // 查询玩家身上资源是否满足 - value := this.moduleHero.api.user.QueryAttributeValue(session.GetUserId(), v.T) + value := this.user.QueryAttributeValue(session.GetUserId(), v.T) if value >= v.N { bCheckOk = true // 财富校验通过 break @@ -105,7 +105,7 @@ func (this *apiComp) Resonance(session comm.IUserSession, agrs map[string]interf } for _, v := range resonConfig.Need { if v.A == "attr" { // 查询玩家身上资源是否满足 - value := this.moduleHero.api.user.QueryAttributeValue(session.GetUserId(), v.T) + value := this.user.QueryAttributeValue(session.GetUserId(), v.T) if value >= v.N { // 直接删除财富 code = this.user.AddAttributeValue(session.GetUserId(), v.T, value-v.N) // 扣除资源 break diff --git a/modules/hero/api_resonanceReset.go b/modules/hero/api_resonanceReset.go index bd96a6403..308085c2d 100644 --- a/modules/hero/api_resonanceReset.go +++ b/modules/hero/api_resonanceReset.go @@ -42,7 +42,7 @@ func (this *apiComp) ResonanceResetCheck(session comm.IUserSession, req *pb.Hero } for _, v := range _costConfig.Var { if v.A == "attr" { - value := this.moduleHero.api.user.QueryAttributeValue(session.GetUserId(), v.T) + value := this.user.QueryAttributeValue(session.GetUserId(), v.T) if value < v.N { code.Code = pb.ErrorCode_ResNoEnough // 资源不足 return @@ -72,7 +72,7 @@ func (this *apiComp) ResonanceReset(session comm.IUserSession, agrs map[string]i for _, v := range _costConfig.Var { if v.A == "attr" { - code = this.moduleHero.api.user.AddAttributeValue(session.GetUserId(), v.T, -v.N) // 扣资源 + code = this.user.AddAttributeValue(session.GetUserId(), v.T, -v.N) // 扣资源 } }