上传装备bug修复
This commit is contained in:
parent
251526932d
commit
45ac29b18a
@ -35,6 +35,12 @@ func (this *apiComp) Equip(session comm.IUserSession, req *pb.EquipmentEquipReq)
|
|||||||
//校验数据
|
//校验数据
|
||||||
confs = make([]*cfg.Game_equipData, len(req.EquipmentId))
|
confs = make([]*cfg.Game_equipData, len(req.EquipmentId))
|
||||||
equipments = make([]*pb.DB_Equipment, len(req.EquipmentId))
|
equipments = make([]*pb.DB_Equipment, len(req.EquipmentId))
|
||||||
|
|
||||||
|
//获取英雄数据
|
||||||
|
if hero, code = this.module.ModuleHero.GetHero(session.GetUserId(), req.HeroCardId); code != pb.ErrorCode_Success {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
for i, v := range req.EquipmentId {
|
for i, v := range req.EquipmentId {
|
||||||
if v != "" {
|
if v != "" {
|
||||||
if equipments[i], err = this.module.modelEquipment.QueryUserEquipmentsById(session.GetUserId(), v); err != nil {
|
if equipments[i], err = this.module.modelEquipment.QueryUserEquipmentsById(session.GetUserId(), v); err != nil {
|
||||||
@ -42,7 +48,7 @@ func (this *apiComp) Equip(session comm.IUserSession, req *pb.EquipmentEquipReq)
|
|||||||
code = pb.ErrorCode_EquipmentOnFoundEquipment
|
code = pb.ErrorCode_EquipmentOnFoundEquipment
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if equipments[i].HeroId != "" { //装备已经有宿主了
|
if equipments[i].HeroId != "" && hero.Id != equipments[i].HeroId { //装备已经有宿主了
|
||||||
code = pb.ErrorCode_ReqParameterError
|
code = pb.ErrorCode_ReqParameterError
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -56,10 +62,7 @@ func (this *apiComp) Equip(session comm.IUserSession, req *pb.EquipmentEquipReq)
|
|||||||
equipments[i] = nil
|
equipments[i] = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//获取英雄数据
|
|
||||||
if hero, code = this.module.ModuleHero.GetHero(session.GetUserId(), req.HeroCardId); code != pb.ErrorCode_Success {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
//读取英雄原装备
|
//读取英雄原装备
|
||||||
for i, v := range hero.EquipID {
|
for i, v := range hero.EquipID {
|
||||||
if v != "" {
|
if v != "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user