Core/Auras:
* Fixed loading aura charges when they would exceed count set in SpellEntry while still remaining a valid value due to spell modifiers (that might not yet be active) * Fixed refreshing aura charges when recasting the spell Closes #1803 Closes #1786 Closes #1805
This commit is contained in:
@@ -17130,19 +17130,22 @@ void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff)
|
||||
// prevent wrong values of remaincharges
|
||||
if (spellproto->procCharges)
|
||||
{
|
||||
if (remaincharges <= 0 || remaincharges > spellproto->procCharges)
|
||||
// we have no control over the order of applying auras and modifiers allow auras
|
||||
// to have more charges than value in SpellEntry
|
||||
if (remaincharges <= 0/* || remaincharges > spellproto->procCharges*/)
|
||||
remaincharges = spellproto->procCharges;
|
||||
}
|
||||
else
|
||||
remaincharges = 0;
|
||||
|
||||
if (Aura * aura = Aura::TryCreate(spellproto, effmask, this, NULL, &baseDamage[0], NULL, caster_guid))
|
||||
if (Aura* aura = Aura::TryCreate(spellproto, effmask, this, NULL, &baseDamage[0], NULL, caster_guid))
|
||||
{
|
||||
if (!aura->CanBeSaved())
|
||||
{
|
||||
aura->Remove();
|
||||
continue;
|
||||
}
|
||||
|
||||
aura->SetLoadedState(maxduration, remaintime, remaincharges, stackcount, recalculatemask, &damage[0]);
|
||||
aura->ApplyForTargets();
|
||||
sLog->outDetail("Added aura spellid %u, effectmask %u", spellproto->Id, effmask);
|
||||
|
||||
Reference in New Issue
Block a user