From ea48acbf0b94e218736425707ee497f39bef41b1 Mon Sep 17 00:00:00 2001 From: Noudess Date: Mon, 11 May 2020 15:39:28 -0400 Subject: [PATCH] Added check for GetItem() failure on Pole --- zone/forage.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/zone/forage.cpp b/zone/forage.cpp index 7a166174a..069f2be63 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -369,9 +369,13 @@ void Client::GoFish() //this is potentially exploitable in that they can fish //and then swap out items in primary slot... too lazy to fix right now const EQEmu::ItemInstance* Pole = m_inv[EQEmu::invslot::slotPrimary]; - if (Pole && Pole->GetItem()->SubType == 0 && zone->random.Int(0, 49) == 1) { - MessageString(Chat::Skills, FISHING_POLE_BROKE); //Your fishing pole broke! - DeleteItemInInventory(EQEmu::invslot::slotPrimary, 0, true); + + if (Pole) { + const EQEmu::ItemData* fishing_item = Pole->GetItem(); + if (fishing_item && fishing_item->SubType == 0 && zone->random.Int(0, 49) == 1) { + MessageString(Chat::Skills, FISHING_POLE_BROKE); //Your fishing pole broke! + DeleteItemInInventory(EQEmu::invslot::slotPrimary, 0, true); + } } if (CheckIncreaseSkill(EQEmu::skills::SkillFishing, nullptr, 5))