aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellEffects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/SpellEffects.cpp')
-rw-r--r--src/game/SpellEffects.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 067edf5a7d4..45c7fe1af60 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -3125,20 +3125,24 @@ void Spell::EffectCreateItem2(uint32 i)
uint32 item_id = m_spellInfo->EffectItemType[i];
- DoCreateItem(i, item_id);
+ if (item_id)
+ DoCreateItem(i, item_id);
// special case: fake item replaced by generate using spell_loot_template
if (IsLootCraftingSpell(m_spellInfo))
{
- if (!player->HasItemCount(item_id, 1))
- return;
+ if (item_id)
+ {
+ if (!player->HasItemCount(item_id, 1))
+ return;
- // remove reagent
- uint32 count = 1;
- player->DestroyItemCount(item_id, count, true);
+ // remove reagent
+ uint32 count = 1;
+ player->DestroyItemCount(item_id, count, true);
- // create some random items
- player->AutoStoreLoot(m_spellInfo->Id, LootTemplates_Spell);
+ // create some random items
+ player->AutoStoreLoot(m_spellInfo->Id, LootTemplates_Spell);
+ }
}
}