From 538698be0784616c0c5d0ef31c97b426dcbba177 Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Thu, 4 Jul 2024 17:10:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A0=E7=89=A9=E6=8A=80=E8=83=BD=E7=BA=A2?= =?UTF-8?q?=E7=82=B9=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/petmgr.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/worldsrv/petmgr.go b/worldsrv/petmgr.go index 0c11c82..720838c 100644 --- a/worldsrv/petmgr.go +++ b/worldsrv/petmgr.go @@ -344,7 +344,12 @@ func (this *PetMgr) CheckShowRed(p *Player) { status := true for itemId, itemNum := range SkillInfo.ItemConsum { item := BagMgrSingleton.GetItem(p.SnId, int32(itemId)) - if item.ItemNum < itemNum { + if item != nil { + if item.ItemNum < itemNum { + status = false + break + } + } else { status = false break } @@ -363,7 +368,12 @@ func (this *PetMgr) CheckShowRed(p *Player) { status := true for itemId, itemNum := range SkillInfo.ItemConsum { item := BagMgrSingleton.GetItem(p.SnId, int32(itemId)) - if item.ItemNum < itemNum { + if item != nil { + if item.ItemNum < itemNum { + status = false + break + } + } else { status = false break }