diff options
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index f001921fbf2..d24e3337e6c 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1369,25 +1369,19 @@ void Spell::DoCreateItem(uint32 itemId, ItemContext context /*= ItemContext::NON if (num_to_add) { // create the new item and store it - Item* pItem = player->StoreNewItem(dest, newitemid, true, GenerateItemRandomBonusListId(newitemid), GuidSet(), context, bonusListIDs); - - // was it successful? return error if not - if (!pItem) + if (Item* pItem = player->StoreNewItem(dest, newitemid, true, GenerateItemRandomBonusListId(newitemid), GuidSet(), context, bonusListIDs)) { - player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr); - return; - } + // set the "Crafted by ..." property of the item + if (pItem->GetTemplate()->HasSignature()) + pItem->SetCreator(player->GetGUID()); - // set the "Crafted by ..." property of the item - if (pItem->GetTemplate()->HasSignature()) - pItem->SetCreator(player->GetGUID()); + // send info to the client + player->SendNewItem(pItem, num_to_add, true, true); - // send info to the client - player->SendNewItem(pItem, num_to_add, true, true); - - if (pItem->GetQuality() > ITEM_QUALITY_EPIC || (pItem->GetQuality() == ITEM_QUALITY_EPIC && pItem->GetItemLevel(player) >= MinNewsItemLevel)) - if (Guild* guild = player->GetGuild()) - guild->AddGuildNews(GUILD_NEWS_ITEM_CRAFTED, player->GetGUID(), 0, pProto->GetId()); + if (pItem->GetQuality() > ITEM_QUALITY_EPIC || (pItem->GetQuality() == ITEM_QUALITY_EPIC && pItem->GetItemLevel(player) >= MinNewsItemLevel)) + if (Guild* guild = player->GetGuild()) + guild->AddGuildNews(GUILD_NEWS_ITEM_CRAFTED, player->GetGUID(), 0, pProto->GetId()); + } // we succeeded in creating at least one item, so a levelup is possible player->UpdateCraftSkill(m_spellInfo); |