Remove InteractedWithEvent and friends. (#11939)

This commit is contained in:
Leon Friedrich
2022-10-26 14:15:48 +13:00
committed by GitHub
parent b03f17bda2
commit c0b657ca18
21 changed files with 133 additions and 101 deletions

View File

@@ -154,6 +154,23 @@ namespace Content.Shared.Verbs
/// <remarks>
/// This will try to call the action delegates and raise the local events for the given verb.
/// </remarks>
public abstract void ExecuteVerb(Verb verb, EntityUid user, EntityUid target, bool forced = false);
public virtual void ExecuteVerb(Verb verb, EntityUid user, EntityUid target, bool forced = false)
{
// invoke any relevant actions
verb.Act?.Invoke();
// Maybe raise a local event
if (verb.ExecutionEventArgs != null)
{
if (verb.EventTarget.IsValid())
RaiseLocalEvent(verb.EventTarget, verb.ExecutionEventArgs);
else
RaiseLocalEvent(verb.ExecutionEventArgs);
}
// Perform any contact interactions
if (verb.DoContactInteraction ?? (verb.DefaultDoContactInteraction && _interactionSystem.InRangeUnobstructed(user, target)))
_interactionSystem.DoContactInteraction(user, target);
}
}
}