*Fix a crash in latest rev.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-03-22 16:53:56 +01:00
parent a0530658ff
commit df553a98dd
3 changed files with 10 additions and 10 deletions
+4 -1
View File
@@ -1196,7 +1196,10 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
if (GetSpellDuration(i->first)==-1)
// get duration from aura-only once
if (!_duration)
_duration = unit->GetAuraByCasterSpell(m_spellInfo->Id, m_caster->GetGUID())->GetAuraDuration();
{
Aura * aur = unit->GetAuraByCasterSpell(m_spellInfo->Id, m_caster->GetGUID());
_duration = aur ? aur->GetAuraDuration() : -1;
}
unit->SetAurasDurationByCasterSpell(i->first->Id, m_caster->GetGUID(), _duration);
}
}
+4 -7
View File
@@ -240,9 +240,8 @@ class TRINITY_DLL_SPEC Aura
}
void SetAuraDurationAndUpdate(int32 duration)
{
m_duration = duration;
if(GetAuraSlot() < MAX_AURAS) // slot found send data to client
{ m_target->UpdateAuraForGroup(GetAuraSlot()); }
SetAuraDuration (duration);
m_target->UpdateAuraForGroup(GetAuraSlot());
}
time_t GetAuraApplyTime() { return m_applyTime; }
@@ -269,16 +268,14 @@ class TRINITY_DLL_SPEC Aura
if (m_procCharges == charges)
return;
m_procCharges = charges;
if(GetAuraSlot() < MAX_AURAS) // slot found send data to client
{ m_target->UpdateAuraForGroup(GetAuraSlot()); }
m_target->UpdateAuraForGroup(GetAuraSlot());
}
bool DropAuraCharge() // return true if last charge dropped
{
if (m_procCharges == 0)
return false;
m_procCharges--;
if(GetAuraSlot() < MAX_AURAS) // slot found send data to client
{ m_target->UpdateAuraForGroup(GetAuraSlot()); }
m_target->UpdateAuraForGroup(GetAuraSlot());
return m_procCharges == 0;
}
+2 -2
View File
@@ -4160,7 +4160,7 @@ void Unit::SetAurasDurationByCasterSpell(uint32 spellId, uint64 casterGUID, int3
{
if(itr->second->GetCasterGUID()==casterGUID)
{
itr->second->SetAuraDuration(duration);
itr->second->SetAuraDurationAndUpdate(duration);
break;
}
}
@@ -6027,7 +6027,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if( spellProto->SpellFamilyName == SPELLFAMILY_ROGUE &&
spellProto->SpellFamilyFlags[0] & 0x40000)
{
RefreshAurasByCasterSpell(spellProto->Id, GetGUID());
SetAurasDurationByCasterSpell(spellProto->Id, GetGUID(), GetSpellMaxDuration(spellProto));
return true;
}
}