aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellAuras.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/SpellAuras.cpp')
-rw-r--r--src/game/SpellAuras.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index e394f9a18ca..ddc1b9c59a4 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -1260,14 +1260,16 @@ void Aura::SetAuraCharges(uint8 charges)
SendAuraUpdate();
}
-bool Aura::DropAuraCharge()
+void Aura::DropAuraCharge()
{
- if (m_procCharges == 0)
- return false;
- m_procCharges--;
- SendAuraUpdate();
- // return true if last charge dropped
- return m_procCharges == 0;
+ if(m_procCharges) //auras without charges always have charge = 0
+ {
+ --m_procCharges;
+ if(m_procCharges) // Send charge change
+ SendAuraUpdate();
+ else // Last charge dropped
+ m_target->RemoveAura(this);
+ }
}
bool Aura::IsPersistent() const