Core/Misc: Various crash fixes
Port From (https://github.com/TrinityCore/TrinityCore/commit/4f65dc5e20cc3af5b3595809707c632faa6e5900)
This commit is contained in:
@@ -928,7 +928,8 @@ namespace Game.Spells
|
||||
if (IsPassive())
|
||||
return false;
|
||||
|
||||
if (GetCasterGUID() != GetOwner().GetGUID())
|
||||
// Check if aura is single target, not only spell info
|
||||
if (GetCasterGUID() != GetOwner().GetGUID() || IsSingleTarget())
|
||||
if (GetSpellInfo().IsSingleTarget())
|
||||
return false;
|
||||
|
||||
@@ -940,6 +941,18 @@ namespace Game.Spells
|
||||
if (HasEffectType(AuraType.ControlVehicle))
|
||||
return false;
|
||||
|
||||
// do not save bind sight auras
|
||||
if (HasEffectType(AuraType.BindSight))
|
||||
return false;
|
||||
|
||||
// no charming auras (taking direct control)
|
||||
if (HasEffectType(AuraType.ModPossess) || HasEffectType(AuraType.ModPossessPet))
|
||||
return false;
|
||||
|
||||
// no charming auras can be saved
|
||||
if (HasEffectType(AuraType.ModCharm) || HasEffectType(AuraType.AoeCharm))
|
||||
return false;
|
||||
|
||||
// Incanter's Absorbtion - considering the minimal duration and problems with aura stacking
|
||||
// we skip saving this aura
|
||||
// Also for some reason other auras put as MultiSlot crash core on keeping them after restart,
|
||||
|
||||
@@ -4284,7 +4284,7 @@ namespace Game.Spells
|
||||
return SpellCastResult.SpellInProgress;
|
||||
|
||||
// check if we are using a potion in combat for the 2nd+ time. Cooldown is added only after caster gets out of combat
|
||||
if (m_caster.ToPlayer().GetLastPotionId() != 0 && m_CastItem && (m_CastItem.IsPotion() || m_spellInfo.IsCooldownStartedOnEvent()))
|
||||
if (!IsIgnoringCooldowns() && m_caster.ToPlayer().GetLastPotionId() != 0 && m_CastItem && (m_CastItem.IsPotion() || m_spellInfo.IsCooldownStartedOnEvent()))
|
||||
return SpellCastResult.NotReady;
|
||||
}
|
||||
|
||||
|
||||
@@ -189,6 +189,9 @@ namespace Game.Spells
|
||||
|
||||
public void HandleCooldowns(SpellInfo spellInfo, uint itemId, Spell spell = null)
|
||||
{
|
||||
if (spell != null && spell.IsIgnoringCooldowns())
|
||||
return;
|
||||
|
||||
if (ConsumeCharge(spellInfo.ChargeCategoryId))
|
||||
return;
|
||||
|
||||
@@ -207,7 +210,7 @@ namespace Game.Spells
|
||||
}
|
||||
}
|
||||
|
||||
if (spellInfo.IsCooldownStartedOnEvent() || spellInfo.IsPassive() || (spell && spell.IsIgnoringCooldowns()))
|
||||
if (spellInfo.IsCooldownStartedOnEvent() || spellInfo.IsPassive())
|
||||
return;
|
||||
|
||||
StartCooldown(spellInfo, itemId, spell);
|
||||
|
||||
@@ -3860,8 +3860,7 @@ namespace Game.Spells
|
||||
{
|
||||
return (Effect == SpellEffectName.SummonPlayer)
|
||||
|| (Effect == SpellEffectName.SummonRafFriend)
|
||||
|| (Effect == SpellEffectName.Resurrect)
|
||||
|| (Effect == SpellEffectName.SkinPlayerCorpse);
|
||||
|| (Effect == SpellEffectName.Resurrect);
|
||||
}
|
||||
|
||||
bool IsFarDestTargetEffect()
|
||||
|
||||
Reference in New Issue
Block a user