mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user