From 25c7f68dacf5ae4a06f61a9bb7cc23594ddf140e Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Thu, 25 Jul 2024 14:58:53 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=93=E5=85=B7=E7=A9=BA=E6=8C=87=E9=92=88?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/action_server.go | 3 ++- worldsrv/action_shop.go | 2 +- worldsrv/petmgr.go | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/worldsrv/action_server.go b/worldsrv/action_server.go index dc7769c..080ce3c 100644 --- a/worldsrv/action_server.go +++ b/worldsrv/action_server.go @@ -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 { diff --git a/worldsrv/action_shop.go b/worldsrv/action_shop.go index c790bd9..da91248 100644 --- a/worldsrv/action_shop.go +++ b/worldsrv/action_shop.go @@ -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 } diff --git a/worldsrv/petmgr.go b/worldsrv/petmgr.go index 3a5142b..2e2e279 100644 --- a/worldsrv/petmgr.go +++ b/worldsrv/petmgr.go @@ -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 }