道具空指针异常
This commit is contained in:
parent
857f052728
commit
25c7f68dac
|
|
@ -172,7 +172,8 @@ func init() {
|
|||
if items != nil {
|
||||
for _, dbItem := range dbItemArr {
|
||||
//todo 临时修复,正常应该道具需要使用事务同步
|
||||
if dbItem.GetId() == common.ItemIDPermit {
|
||||
switch dbItem.GetId() {
|
||||
case common.ItemIDPermit, common.ItemIDWeekScore:
|
||||
continue
|
||||
}
|
||||
if itemNum, exist := items[dbItem.Id]; exist {
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ func (this *CSVCPayShopHandler) Process(s *netlib.Session, packetid int, data in
|
|||
}
|
||||
case ShopConsumeDiamondScore:
|
||||
item := BagMgrSingleton.GetItem(p.SnId, common.ItemDiamondScore)
|
||||
if costNum > item.ItemNum {
|
||||
if item == nil || costNum > item.ItemNum {
|
||||
SendClient(shop.OpResultCode_OPRC_Error)
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ func (this *PetMgr) CheckSkinRed(p *Player) {
|
|||
ok := true
|
||||
for _, v := range info.GetCost() {
|
||||
item := BagMgrSingleton.GetItem(p.SnId, v.GetId())
|
||||
if item.ItemNum < v.GetN() {
|
||||
if item == nil || item.ItemNum < v.GetN() {
|
||||
ok = false
|
||||
break
|
||||
}
|
||||
|
|
@ -356,7 +356,7 @@ func (this *PetMgr) CheckSkinRed(p *Player) {
|
|||
ok := true
|
||||
for _, v := range info.GetCost() {
|
||||
item := BagMgrSingleton.GetItem(p.SnId, v.GetId())
|
||||
if item.ItemNum < v.GetN() {
|
||||
if item == nil || item.ItemNum < v.GetN() {
|
||||
ok = false
|
||||
break
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue