上传装备附魔代码修复
This commit is contained in:
parent
8574cd8398
commit
f32bf350ab
@ -25,6 +25,7 @@ func (this *apiComp) Ench(session comm.IUserSession, req *pb.EquipmentEnchReq) (
|
||||
conf *cfg.GameEquipEnchantingData
|
||||
hero *pb.DBHero
|
||||
equipments []*pb.DB_Equipment
|
||||
need []*cfg.Gameatn
|
||||
AttrValue int32
|
||||
err error
|
||||
)
|
||||
@ -35,6 +36,17 @@ func (this *apiComp) Ench(session comm.IUserSession, req *pb.EquipmentEnchReq) (
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
need = make([]*cfg.Gameatn, 0)
|
||||
need = append(need, conf.Need...)
|
||||
need = append(need, &cfg.Gameatn{
|
||||
A: comm.ItemType,
|
||||
T: req.Itemid,
|
||||
N: 1,
|
||||
})
|
||||
if code = this.module.ConsumeRes(session, need, true); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
|
||||
if equip, err = this.module.modelEquipment.QueryUserEquipmentsById(session.GetUserId(), req.Eid); err != nil {
|
||||
this.module.Errorf("Equip reader uid:%s equipment:%s err:%v", session.GetUserId(), req.Eid, err)
|
||||
code = pb.ErrorCode_SystemError
|
||||
@ -57,6 +69,7 @@ func (this *apiComp) Ench(session comm.IUserSession, req *pb.EquipmentEnchReq) (
|
||||
return
|
||||
}
|
||||
if equip.HeroId != "" {
|
||||
equipments = make([]*pb.DB_Equipment, 8)
|
||||
if hero, code = this.module.ModuleHero.GetHeroByObjID(session.GetUserId(), equip.HeroId); code != pb.ErrorCode_Success {
|
||||
this.module.Errorf("Upgrade code:%d", code)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user