diff --git a/modules/equipment/api_equip.go b/modules/equipment/api_equip.go index 95b11e0e8..d039e8549 100644 --- a/modules/equipment/api_equip.go +++ b/modules/equipment/api_equip.go @@ -19,14 +19,15 @@ func (this *apiComp) EquipCheck(session comm.IUserSession, req *pb.EquipmentEqui ///英雄挂在装备 code 错误码信息 data 错误附加数据 func (this *apiComp) Equip(session comm.IUserSession, req *pb.EquipmentEquipReq) (code pb.ErrorCode, data *pb.ErrorData) { var ( - err error - confs []*cfg.GameEquipData - equipment *pb.DB_Equipment - equipments []*pb.DB_Equipment - updatequipment []*pb.DB_Equipment - equipNum int32 - equipStr map[int32]int32 = make(map[int32]int32) - equipLv map[int32]int32 = make(map[int32]int32) + err error + confs []*cfg.GameEquipData + equipment *pb.DB_Equipment + equipments []*pb.DB_Equipment + updatequipment []*pb.DB_Equipment + equipNum int32 + equipStr map[int32]int32 = make(map[int32]int32) + // equipLv map[int32]int32 = make(map[int32]int32) + minlv int32 = 9999 hero *pb.DBHero suite1Str, suite1Lv, suite2Str, suite2Lv int32 = math.MaxInt32, math.MaxInt32, math.MaxInt32, math.MaxInt32 tasks []*comm.TaskParam = make([]*comm.TaskParam, 0) @@ -56,7 +57,10 @@ func (this *apiComp) Equip(session comm.IUserSession, req *pb.EquipmentEquipReq) code = pb.ErrorCode_EquipmentIsWorn return } - equipLv[equipments[i].Lv]++ + if minlv > equipments[i].Lv { + minlv = equipments[i].Lv + } + // equipLv[equipments[i].Lv]++ if confs[i], err = this.module.configure.GetEquipmentConfigureById(equipments[i].CId); err != nil { this.module.Errorf("Equip_Check err:%v", err) code = pb.ErrorCode_ConfigNoFound @@ -173,10 +177,11 @@ func (this *apiComp) Equip(session comm.IUserSession, req *pb.EquipmentEquipReq) tasks = append(tasks, comm.GettaskParam(comm.Rtype41, 1, v, k)) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype41, utils.ToInt32(hero.HeroID), v, k) } - for k, v := range equipLv { - tasks = append(tasks, comm.GettaskParam(comm.Rtype42, 1, v, k)) - // this.module.ModuleRtask.SendToRtask(session, comm.Rtype42, utils.ToInt32(hero.HeroID), v, k) - } + tasks = append(tasks, comm.GettaskParam(comm.Rtype42, 1, equipNum, minlv)) + // for k, v := range equipLv { + // tasks = append(tasks, comm.GettaskParam(comm.Rtype42, 1, v, k)) + // // this.module.ModuleRtask.SendToRtask(session, comm.Rtype42, utils.ToInt32(hero.HeroID), v, k) + // } if hero.SuiteId != 0 { tasks = append(tasks, comm.GettaskParam(comm.Rtype49, 1, hero.Suite1Star, hero.Suite1Lv)) tasks = append(tasks, comm.GettaskParam(comm.Rtype98, 1, hero.Suite1Lv))