Core/Auras: Fixed a crash happening when different vehicle auras from the same caster stacked on one target

Closes #10050
This commit is contained in:
Shauren
2013-06-20 15:36:32 +02:00
parent e178f74040
commit f3ec76faeb

View File

@@ -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