Skip to content

Commit

Permalink
[9301] Implement proper check of broken spells for IsLootCraftingSpel…
Browse files Browse the repository at this point in the history
…l case.
  • Loading branch information
VladimirMangos committed Feb 4, 2010
1 parent 0ee1c3a commit 08fc3f6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
19 changes: 18 additions & 1 deletion src/game/SpellMgr.cpp
Expand Up @@ -2621,7 +2621,24 @@ bool SpellMgr::IsSpellValid(SpellEntry const* spellInfo, Player* pl, bool msg)
case SPELL_EFFECT_CREATE_ITEM:
case SPELL_EFFECT_CREATE_ITEM_2:
{
if(!ObjectMgr::GetItemPrototype( spellInfo->EffectItemType[i] ))
if (spellInfo->EffectItemType[i] == 0)
{
// skip auto-loot crafting spells, its not need explicit item info (but have special fake items sometime)
if (!IsLootCraftingSpell(spellInfo))
{
if(msg)
{
if(pl)
ChatHandler(pl).PSendSysMessage("Craft spell %u not have create item entry.",spellInfo->Id);
else
sLog.outErrorDb("Craft spell %u not have create item entry.",spellInfo->Id);
}
return false;
}

}
// also possible IsLootCraftingSpell case but fake item must exist anyway
else if (!ObjectMgr::GetItemPrototype( spellInfo->EffectItemType[i] ))
{
if(msg)
{
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9300"
#define REVISION_NR "9301"
#endif // __REVISION_NR_H__

0 comments on commit 08fc3f6

Please sign in to comment.