Core/Spells: Spells that can be spellstolen that have a permanent duration should respect the 2 minute spellsteal buff duration limit.

This commit is contained in:
Machiavelli
2011-08-07 17:49:02 +02:00
parent 7ec4ebdc24
commit 3109d9c0ae
+4 -3
View File
@@ -3755,7 +3755,8 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit*
}
bool stealCharge = aura->GetSpellInfo()->AttributesEx7 & SPELL_ATTR7_DISPEL_CHARGES;
int32 dur = std::min(2 * MINUTE * IN_MILLISECONDS, aura->GetDuration());
// Cast duration to unsigned to prevent permanent aura's such as Righteous Fury being permanently added to caster
uint32 dur = std::min(2u * MINUTE * IN_MILLISECONDS, uint32(aura->GetDuration()));
if (Aura* newAura = stealer->GetAura(aura->GetId(), aura->GetCasterGUID()))
{
@@ -3763,7 +3764,7 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit*
newAura->ModCharges(1);
else
newAura->ModStackAmount(1);
newAura->SetDuration(dur);
newAura->SetDuration(int32(dur));
}
else
{
@@ -3782,7 +3783,7 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit*
caster->GetSingleCastAuras().push_back(aura);
}
// FIXME: using aura->GetMaxDuration() maybe not blizzlike but it fixes stealing of spells like Innervate
newAura->SetLoadedState(aura->GetMaxDuration(), dur, stealCharge ? 1 : aura->GetCharges(), 1, recalculateMask, &damage[0]);
newAura->SetLoadedState(aura->GetMaxDuration(), int32(dur), stealCharge ? 1 : aura->GetCharges(), 1, recalculateMask, &damage[0]);
newAura->ApplyForTargets();
}
}