[8011] Send energize packets in correct order to avoid strange client behaviour.

If you send SMSG_SPELLENERGIZELOG after SMSG_POWER_UPDATE client shows mana gain twice.

Signed-off-by: hunuza <hunuza@gmail.com>
This commit is contained in:
nos4r2zod 2009-06-14 12:05:04 +02:00 committed by hunuza
parent dcba023261
commit 82d3e2ae7d
5 changed files with 13 additions and 10 deletions

View file

@ -2369,9 +2369,7 @@ void Spell::EffectPowerDrain(uint32 i)
int32 gain = int32(new_damage * manaMultiplier);
m_caster->ModifyPower(POWER_MANA,gain);
//send log
m_caster->SendEnergizeSpellLog(m_caster, m_spellInfo->Id, gain, POWER_MANA);
m_caster->EnergizeBySpell(m_caster, m_spellInfo->Id, gain, POWER_MANA);
}
}
@ -2792,8 +2790,7 @@ void Spell::EffectEnergize(uint32 i)
if(unitTarget->GetMaxPower(power) == 0)
return;
unitTarget->ModifyPower(power,damage);
m_caster->SendEnergizeSpellLog(unitTarget, m_spellInfo->Id, damage, power);
m_caster->EnergizeBySpell(unitTarget, m_spellInfo->Id, damage, power);
// Mad Alchemist's Potion
if (m_spellInfo->Id == 45051)
@ -2855,8 +2852,7 @@ void Spell::EffectEnergisePct(uint32 i)
return;
uint32 gain = damage * maxPower / 100;
unitTarget->ModifyPower(power, gain);
m_caster->SendEnergizeSpellLog(unitTarget, m_spellInfo->Id, gain, power);
m_caster->EnergizeBySpell(unitTarget, m_spellInfo->Id, gain, power);
}
void Spell::SendLoot(uint64 guid, LootType loottype)