*Fix a crash caused by using item.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-01-08 09:43:50 -06:00
parent 3df72ce461
commit e86712bb6d
3 changed files with 5 additions and 4 deletions
+2 -1
View File
@@ -2090,7 +2090,8 @@ void Spell::prepare(SpellCastTargets * targets, Aura* triggeredByAura)
// set timer base at cast time
ReSetTimer();
if(m_IsTriggeredSpell || !m_casttime && !m_spellInfo->StartRecoveryTime && GetCurrentContainer() == CURRENT_GENERIC_SPELL)
//item: first cast may destroy item and second cast causes crash
if(m_IsTriggeredSpell || !m_casttime && !m_spellInfo->StartRecoveryTime && !m_castItemGUID && GetCurrentContainer() == CURRENT_GENERIC_SPELL)
cast(true);
else
{
+1 -1
View File
@@ -641,7 +641,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
CreatureInfo const* cInfo = ((Creature*)pVictim)->GetCreatureInfo();
if(cInfo && cInfo->lootid)
pVictim->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
pVictim->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
// some critters required for quests
if(GetTypeId() == TYPEID_PLAYER)