Core/Spells: Fixed spell target selection not being shared by multiple effects when there are targeting scripts that have the same script function
Port From (https://github.com/TrinityCore/TrinityCore/commit/b1d8061a0f848241fe70ab0d718e829836cb5601)
This commit is contained in:
@@ -392,7 +392,12 @@ namespace Game.Scripting
|
||||
public Targets GetTarget() { return _targetType; }
|
||||
}
|
||||
|
||||
public class ObjectAreaTargetSelectHandler : TargetHook
|
||||
public interface ITargetFunction
|
||||
{
|
||||
public virtual bool HasSameTargetFunctionAs<T>(T other) { return false; }
|
||||
}
|
||||
|
||||
public class ObjectAreaTargetSelectHandler : TargetHook, ITargetFunction
|
||||
{
|
||||
SpellObjectAreaTargetSelectFnType _callImpl;
|
||||
|
||||
@@ -405,9 +410,14 @@ namespace Game.Scripting
|
||||
{
|
||||
_callImpl(targets);
|
||||
}
|
||||
|
||||
public bool HasSameTargetFunctionAs(ObjectAreaTargetSelectHandler other)
|
||||
{
|
||||
return _callImpl.Method == other._callImpl.Method || _callImpl.Target == other._callImpl.Target;
|
||||
}
|
||||
}
|
||||
|
||||
public class ObjectTargetSelectHandler : TargetHook
|
||||
public class ObjectTargetSelectHandler : TargetHook, ITargetFunction
|
||||
{
|
||||
SpellObjectTargetSelectFnType _callImpl;
|
||||
|
||||
@@ -420,6 +430,11 @@ namespace Game.Scripting
|
||||
{
|
||||
_callImpl(ref target);
|
||||
}
|
||||
|
||||
public bool HasSameTargetFunctionAs(ObjectTargetSelectHandler other)
|
||||
{
|
||||
return _callImpl.Method == other._callImpl.Method || _callImpl.Target == other._callImpl.Target;
|
||||
}
|
||||
}
|
||||
|
||||
public class DestinationTargetSelectHandler : TargetHook
|
||||
|
||||
Reference in New Issue
Block a user