diff options
author | Shauren <shauren.trinity@gmail.com> | 2013-06-20 15:36:32 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2013-06-20 15:36:32 +0200 |
commit | f3ec76faeb63009ddff357a93b61220fc6039f47 (patch) | |
tree | a97fa3329d45735b9f74c6a4c5fef0273ca36a27 | |
parent | e178f740402cdb17a52d3f456d8e83c7f17c65ea (diff) |
Core/Auras: Fixed a crash happening when different vehicle auras from the same caster stacked on one target
Closes #10050
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuras.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index d9483a848f6..7e6f1d1b402 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1878,20 +1878,7 @@ bool Aura::CanStackWith(Aura const* existingAura) const } } - bool isVehicleAura1 = false; - bool isVehicleAura2 = false; - uint8 i = 0; - while (i < MAX_SPELL_EFFECTS && !(isVehicleAura1 && isVehicleAura2)) - { - if (m_spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_CONTROL_VEHICLE) - isVehicleAura1 = true; - if (existingSpellInfo->Effects[i].ApplyAuraName == SPELL_AURA_CONTROL_VEHICLE) - isVehicleAura2 = true; - - ++i; - } - - if (isVehicleAura1 && isVehicleAura2) + if (HasEffectType(SPELL_AURA_CONTROL_VEHICLE) && existingAura->HasEffectType(SPELL_AURA_CONTROL_VEHICLE)) { Vehicle* veh = NULL; if (GetOwner()->ToUnit()) @@ -1903,7 +1890,7 @@ bool Aura::CanStackWith(Aura const* existingAura) const if (!veh->GetAvailableSeatCount()) return false; // No empty seat available - return true; // Empty seat available (skip rest) + return !sameCaster; // Empty seat available (skip rest) and different caster } // spell of same spell rank chain |