aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellAuras.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-11 18:26:04 -0500
committermegamage <none@none>2009-08-11 18:26:04 -0500
commit978242da3f5deb4ee4bc0e6e3124bf2c66c405d1 (patch)
treeacf6ff21793761887e0792f4a101e3b25562a52b /src/game/SpellAuras.cpp
parent3078bf6fd0be0af62566cd08dddaebd310610be4 (diff)
*Try to fix a crash caused by single target auras. Thanks to QAston.
--HG-- branch : trunk
Diffstat (limited to 'src/game/SpellAuras.cpp')
-rw-r--r--src/game/SpellAuras.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 038583bee42..9eb9a4ef62b 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -1521,6 +1521,18 @@ bool Aura::DropAuraCharge()
return false;
}
+bool Aura::CanBeSaved() const
+{
+ if (IsPassive())
+ return false;
+
+ if (GetCasterGUID() != m_target->GetGUID())
+ if (IsSingleTargetSpell(GetSpellProto()) || IsAreaAura())
+ return false;
+
+ return true;
+}
+
bool Aura::IsPersistent() const
{
for(uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
@@ -1799,7 +1811,7 @@ void Aura::UnregisterSingleCastAura()
}
else
{
- sLog.outError("Couldn't find the caster of the single target aura, may crash later!");
+ sLog.outCrash("Couldn't find the caster (guid: "UI64FMTD") of the single target aura %u which is on unit entry %u class %u, may crash later!", GetCasterGUID(), GetId(), m_target->GetEntry(), m_target->getClass());
assert(false);
}
m_isSingleTargetAura = false;