1
This commit is contained in:
parent
a66f1d9a02
commit
7bc0fb7164
@ -598,9 +598,25 @@ func (this *player) CMChooseBattleItem(hdr *f5.MsgHdr, msg *cs.CMChooseBattleIte
|
||||
q5.DuckToSimple(rspObj.ItemNum, &itemNum)
|
||||
q5.DuckToSimple(rspObj.ItemType, &itemType)
|
||||
q5.DuckToSimple(rspObj.ItemSubType, &itemSubType)
|
||||
if itemNum > 0 {
|
||||
found := false
|
||||
for _, p := range(this.battleItems) {
|
||||
if p.itemType == itemType && p.itemSubType == itemSubType {
|
||||
|
||||
p.itemId = itemId
|
||||
p.itemNum = itemNum
|
||||
p.itemType = itemType
|
||||
p.itemSubType = itemSubType
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
p := new(battleItem)
|
||||
p.itemId = itemId
|
||||
p.itemNum = itemNum
|
||||
p.itemType = itemType
|
||||
p.itemSubType = itemSubType
|
||||
q5.AppendSlice(&this.battleItems, p)
|
||||
}
|
||||
}
|
||||
this.SendMsg(rspMsg)
|
||||
|
Loading…
x
Reference in New Issue
Block a user