Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
f963cd0a07
@ -88,13 +88,37 @@ func (this *apiComp) Equip(session comm.IUserSession, agrs map[string]interface{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for i, _ := range equipments {
|
msuit := true
|
||||||
if i != int(confs[i].Pos) {
|
subsit := true
|
||||||
log.Errorf("Equip conf:%v Target:%d Incorrect range!", confs[i], i)
|
for i, v := range equipments { //校验装备位置
|
||||||
code = pb.ErrorCode_SystemError
|
if v != nil {
|
||||||
return
|
if i != int(confs[i].Pos) {
|
||||||
|
log.Errorf("Equip conf:%v Target:%d Incorrect range!", confs[i], i)
|
||||||
|
code = pb.ErrorCode_SystemError
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if i < 4 {
|
||||||
|
msuit = false //主套装没有
|
||||||
|
} else {
|
||||||
|
subsit = false //辅套装没有
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if msuit { //前4个位置都有装备 判断是否存在套装
|
||||||
|
if confs[0].Suittype == confs[1].Suittype &&
|
||||||
|
confs[1].Suittype == confs[2].Suittype &&
|
||||||
|
confs[2].Suittype == confs[3].Suittype {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if subsit { //后2个位置都有装备 判断是否存在套装
|
||||||
|
if confs[4].Suittype == confs[5].Suittype {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//更新装备数据加成
|
||||||
if code = this.module.hero.UpdateEquipment(hero, equipments); code == pb.ErrorCode_Success {
|
if code = this.module.hero.UpdateEquipment(hero, equipments); code == pb.ErrorCode_Success {
|
||||||
if err = this.module.modelEquipment.UpdateByHeroId(session.GetUserId(), updatequipment...); err != nil {
|
if err = this.module.modelEquipment.UpdateByHeroId(session.GetUserId(), updatequipment...); err != nil {
|
||||||
log.Errorf("Equip err%v", err)
|
log.Errorf("Equip err%v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user