From 495d7172b4108d8453562db6963af7fd61343b57 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 4 May 2023 12:02:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=A5=BD=E6=84=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/library/api_usegift.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/library/api_usegift.go b/modules/library/api_usegift.go index 5da8a3c00..fdf9557d2 100644 --- a/modules/library/api_usegift.go +++ b/modules/library/api_usegift.go @@ -67,8 +67,8 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe } // 校验是否是自己喜欢的食物 - _c := this.module.configure.GetFavorability(req.Heroid, _heroObj.Favorlv) - if _c != nil { + _c := this.module.configure.GetFavorability(_heroObj.Heroid, _heroObj.Favorlv) + if _c == nil { code = pb.ErrorCode_ConfigNoFound return } @@ -138,9 +138,9 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe // 任务统计 //赠送英雄礼物并增加N点好感度 if upLv > 0 { - this.module.Errorf("英雄好感度等级提升,英雄ID:%s,增加经验:%s,提升的等级:%d", req.Heroid, addExp, upLv) + this.module.Errorf("英雄好感度等级提升,英雄ID:%s,增加经验:%s,提升的等级:%d", _heroObj.Heroid, addExp, upLv) if rst, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil { // 修改阵营累计好感度 - if heroCfg := this.module.configure.GetHeroConfig(req.Heroid); heroCfg != nil { + if heroCfg := this.module.configure.GetHeroConfig(_heroObj.Heroid); heroCfg != nil { rst.Race[heroCfg.Race] += upLv this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), map[string]interface{}{ "race": rst.Race,