diff --git a/modules/smithy/api_forgeequip.go b/modules/smithy/api_forgeequip.go index 0c5346e2f..082ed9b02 100644 --- a/modules/smithy/api_forgeequip.go +++ b/modules/smithy/api_forgeequip.go @@ -237,29 +237,35 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq stove.Data[req.ReelId].Value += req.Count stove.Forge[req.ReelId] += req.Count + // 可能存在一次升多级的情况 // 检查是否提升了熟练度等级 - nextProficiency := this.module.configure.GetSmithyProficileData(req.ReelId, stove.Data[req.ReelId].Lv+1) - if nextProficiency != nil && nextProficiency.Proficiency <= stove.Data[req.ReelId].Value { // 提升熟练度 - stove.Data[req.ReelId].Lv += 1 + for { + nextProficiency := this.module.configure.GetSmithyProficileData(req.ReelId, stove.Data[req.ReelId].Lv+1) + if nextProficiency != nil && nextProficiency.Proficiency <= stove.Data[req.ReelId].Value { // 提升熟练度 + stove.Data[req.ReelId].Lv += 1 - // 校验是否解锁了新的图纸 - if nextProficiency.Type == comm.SmithyReelType3 { - stove.Data[nextProficiency.Value1] = &pb.Mastery{ - Lv: 1, - Value: 0, + // 校验是否解锁了新的图纸 + if nextProficiency.Type == comm.SmithyReelType3 { + stove.Data[nextProficiency.Value1] = &pb.Mastery{ + Lv: 1, + Value: 0, + } } - } - // 是否解锁新套装 - if nextProficiency.Type == comm.SmithyReelType4 { - if rst, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil { - rst.SuiteId = append(rst.SuiteId, nextProficiency.Value1) + // 是否解锁新套装 + if nextProficiency.Type == comm.SmithyReelType4 { + if rst, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil { + rst.SuiteId = append(rst.SuiteId, nextProficiency.Value1) - this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), map[string]interface{}{ - "suiteId": rst.SuiteId, - }) + this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), map[string]interface{}{ + "suiteId": rst.SuiteId, + }) + } } + } else { + break } } + update["data"] = stove.Data update["forge"] = stove.Forge // 打造次数