diff --git a/modules/library/api_usegift.go b/modules/library/api_usegift.go index 17b73ab13..399229462 100644 --- a/modules/library/api_usegift.go +++ b/modules/library/api_usegift.go @@ -133,6 +133,14 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe // 任务统计 //赠送英雄礼物并增加N点好感度 if upLv > 0 { + if rst, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil { // 修改阵营累计好感度 + if heroCfg := this.module.configure.GetHeroConfig(req.Heroid); heroCfg != nil { + rst.Race[heroCfg.Race] += upLv + this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), map[string]interface{}{ + "race": rst.Race, + }) + } + } // this.module.ModuleRtask.SendToRtask(session, comm.Rtype134, utils.ToInt32(_heroObj.Heroid), upLv) go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype134, utils.ToInt32(_heroObj.Heroid), upLv)) }