Core/Auras: Crash fix.
Check amount of total ticks to avoid division by zero.
This commit is contained in:
@@ -17377,7 +17377,7 @@ uint32 Unit::GetRemainingPeriodicAmount(uint64 caster, uint32 spellId, AuraType
|
|||||||
AuraEffectList const& periodicAuras = GetAuraEffectsByType(auraType);
|
AuraEffectList const& periodicAuras = GetAuraEffectsByType(auraType);
|
||||||
for (AuraEffectList::const_iterator i = periodicAuras.begin(); i != periodicAuras.end(); ++i)
|
for (AuraEffectList::const_iterator i = periodicAuras.begin(); i != periodicAuras.end(); ++i)
|
||||||
{
|
{
|
||||||
if ((*i)->GetCasterGUID() != caster || (*i)->GetId() != spellId || (*i)->GetEffIndex() != effectIndex)
|
if ((*i)->GetCasterGUID() != caster || (*i)->GetId() != spellId || (*i)->GetEffIndex() != effectIndex || (*i)->GetTotalTicks() == 0)
|
||||||
continue;
|
continue;
|
||||||
amount += uint32(((*i)->GetAmount() * std::max<int32>((*i)->GetTotalTicks() - int32((*i)->GetTickNumber()), 0)) / (*i)->GetTotalTicks());
|
amount += uint32(((*i)->GetAmount() * std::max<int32>((*i)->GetTotalTicks() - int32((*i)->GetTickNumber()), 0)) / (*i)->GetTotalTicks());
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user