diff --git a/modules/library/api_getreward.go b/modules/library/api_getreward.go index 3579caf6f..44a956652 100644 --- a/modules/library/api_getreward.go +++ b/modules/library/api_getreward.go @@ -21,7 +21,7 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.LibraryGetRewa if code != pb.ErrorCode_Success { return // 参数校验失败直接返回 } - rsp := &pb.LibraryGetListResp{} + rsp := &pb.LibraryGetRewardResp{} defer session.SendMsg(string(this.module.GetType()), LibraryGetRewardResp, rsp) fetter := this.module.getLibraryByObjID(session.GetUserId(), req.ObjId) if fetter == nil { @@ -41,11 +41,15 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.LibraryGetRewa } fetter.Prize[req.Fetterlv] = 1 // 发奖 - if code = this.module.DispenseRes(session, conf.Prize, true); code != pb.ErrorCode_Success { // - return + if len(conf.Prize) != 0 { + if code = this.module.DispenseRes(session, conf.Prize, true); code != pb.ErrorCode_Success { // + return + } } + mapData := make(map[string]interface{}, 0) mapData["prize"] = fetter.Prize this.module.ModifyLibraryData(session.GetUserId(), fetter.Id, mapData) // 更新内存信息 + rsp.Data = fetter return }