1
0

Assure the db entry of the byproduct is valid to use

This commit is contained in:
Emagi 2025-03-13 06:48:12 -04:00
parent 2c49d9c76e
commit c4c96904d1

View File

@ -490,13 +490,16 @@ void TradeskillMgr::StopCrafting(Client* client, bool lock) {
item->creator = std::string(client->GetPlayer()->GetName()); item->creator = std::string(client->GetPlayer()->GetName());
client->AddItem(item); client->AddItem(item);
if(byproduct_itemid) { if(byproduct_itemid) {
Item* byproductItem = new Item(master_item_list.GetItem(byproduct_itemid)); Item* byproduct = master_item_list.GetItem(byproduct_itemid);
if(byproduct) {
Item* byproductItem = new Item(byproduct);
byproductItem->creator = std::string(client->GetPlayer()->GetName()); byproductItem->creator = std::string(client->GetPlayer()->GetName());
byproductItem->details.count = byproduct_qty; byproductItem->details.count = byproduct_qty;
client->Message(CHANNEL_COLOR_CHAT_RELATIONSHIP, "You received %s as a byproduct.", byproductItem->CreateItemLink(client->GetVersion()).c_str()); client->Message(CHANNEL_COLOR_CHAT_RELATIONSHIP, "You received %s as a byproduct.", byproductItem->CreateItemLink(client->GetVersion()).c_str());
client->AddItem(byproductItem); client->AddItem(byproductItem);
client->GetPlayer()->CheckQuestsCraftUpdate(byproductItem, byproduct_qty); client->GetPlayer()->CheckQuestsCraftUpdate(byproductItem, byproduct_qty);
} }
}
//Check for crafting quest updates //Check for crafting quest updates
int8 update_amt = 0; int8 update_amt = 0;
if(item->stack_count > 1) if(item->stack_count > 1)