From fbe456ed4563bce4e5ef1156a229d84fb62d5fcd Mon Sep 17 00:00:00 2001 From: Daerath Date: Sun, 21 Jan 2018 17:28:27 -0500 Subject: [PATCH] * If GetItem returns null when searching for a container item, we now default bagslots to 10 instead of aborting. --- zone/client_packet.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 3ee4d0038..53fa8a27d 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -11700,11 +11700,13 @@ void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app) auto item = database.GetItem(tsf->some_id); if (!item) { - Log(Logs::General, Logs::Error, "Invalid container ID: %d. GetItem returned null.\n", tsf->some_id); - return; + Log(Logs::General, Logs::Error, "Invalid container ID: %d. GetItem returned null. Defaulting to BagSlots = 10.\n", tsf->some_id); + combineObjectSlots = 10; + } + else + { + combineObjectSlots = item->BagSlots; } - - combineObjectSlots = item->BagSlots; } std::string favoriteIDs; //gotta be big enough for 500 IDs @@ -11772,11 +11774,13 @@ void Client::Handle_OP_RecipesSearch(const EQApplicationPacket *app) auto item = database.GetItem(rss->some_id); if (!item) { - Log(Logs::General, Logs::Error, "Invalid container ID: %d. GetItem returned null.\n", rss->some_id); - return; + Log(Logs::General, Logs::Error, "Invalid container ID: %d. GetItem returned null. Defaulting to BagSlots = 10.\n", rss->some_id); + combineObjectSlots = 10; + } + else + { + combineObjectSlots = item->BagSlots; } - - combineObjectSlots = item->BagSlots; } std::string searchClause;