Fix tradeskill crash with item id 0 in recipe components
This commit is contained in:
parent
965356a69f
commit
6003016c5b
1 changed files with 7 additions and 1 deletions
|
@ -84,7 +84,13 @@ void ClientPacketFunctions::SendCreateFromRecipe(Client* client, int32 recipeID)
|
|||
firstID = *itr;
|
||||
|
||||
item = master_item_list.GetItem(*itr);
|
||||
|
||||
if(!item)
|
||||
{
|
||||
LogWrite(TRADESKILL__ERROR, 0, "Recipes", "Error creating packet to client missing item %u", *itr);
|
||||
client->Message(CHANNEL_COLOR_RED, "Error producing create recipe packet! Recipe is trying to find item %u, but it is missing!", *itr);
|
||||
safe_delete(packet);
|
||||
return;
|
||||
}
|
||||
packet->setArrayDataByName("primary_component", item->name.c_str(), i);
|
||||
packet->setArrayDataByName("primary_item_id", (*itr), i);
|
||||
packet->setArrayDataByName("primary_icon", item->details.icon, i);
|
||||
|
|
Loading…
Add table
Reference in a new issue