Core/Spell: SpellAura Redux

Port From (https://github.com/TrinityCore/TrinityCore/commit/f7299dce9770a5b4a3a5ab289e930a390aa0407a)
This commit is contained in:
hondacrx
2021-11-29 14:38:37 -05:00
parent e08294d332
commit 06be062d91
7 changed files with 44 additions and 19 deletions
+2 -2
View File
@@ -3822,14 +3822,14 @@ namespace Game.Entities
if (aura.IsRemoved())
return;
aura.SetIsSingleTarget(caster != null && aura.GetSpellInfo().IsSingleTarget() || aura.HasEffectType(AuraType.ControlVehicle));
aura.SetIsSingleTarget(caster != null && aura.GetSpellInfo().IsSingleTarget());
if (aura.IsSingleTarget())
{
// @HACK: Player is not in world during loading auras.
//Single target auras are not saved or loaded from database
//but may be created as a result of aura links (player mounts with passengers)
Cypher.Assert((IsInWorld && !IsDuringRemoveFromWorld()) || (aura.GetCasterGUID() == GetGUID()) || (IsLoading() && aura.HasEffectType(AuraType.ControlVehicle)));
Cypher.Assert((IsInWorld && !IsDuringRemoveFromWorld()) || aura.GetCasterGUID() == GetGUID());
// register single target aura
caster.m_scAuras.Add(aura);
+5
View File
@@ -900,6 +900,11 @@ namespace Game.Entities
}
else if (seatId >= 0 && seatId == GetTransSeat())
return;
else
{
//Exit the current vehicle because unit will reenter in a new seat.
m_vehicle.GetBase().RemoveAurasByType(AuraType.ControlVehicle, GetGUID(), aurApp.GetBase());
}
}
if (aurApp.HasRemoveMode())