背包修改
This commit is contained in:
parent
64bcbb896e
commit
e9c29f1442
|
|
@ -216,11 +216,13 @@ func (this *BagMgr) AddItems(p *Player, addItems []*Item, add int64, gainWay int
|
|||
code = bag.OpResultCode_OPRC_IdErr
|
||||
return newBagInfo, code, false
|
||||
}
|
||||
if v.ItemNum < 0 && item.Num < int64(math.Abs(float64(v.ItemNum))) {
|
||||
if itm, exist := newBagInfo.BagItem[v.ItemId]; exist {
|
||||
if v.ItemNum < 0 && itm.ItemNum < int64(math.Abs(float64(v.ItemNum))) {
|
||||
code = bag.OpResultCode_OPRC_UseUp
|
||||
return newBagInfo, code, false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for _, v := range items {
|
||||
if v == nil || v.ItemNum == 0 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue