Remove IActivate (#9705)

* git mv

* purge IActivate

* File scoped NS
This commit is contained in:
Leon Friedrich
2022-07-14 22:29:29 +12:00
committed by GitHub
parent bad837fb85
commit e9616e40f9
5 changed files with 40 additions and 85 deletions

View File

@@ -649,15 +649,6 @@ namespace Content.Shared.Interaction
if (afterInteractEvent.Handled)
return;
var afterInteractEventArgs = new AfterInteractEventArgs(user, clickLocation, target, canReach);
var afterInteracts = AllComps<IAfterInteract>(used).OrderByDescending(x => x.Priority).ToList();
foreach (var afterInteract in afterInteracts)
{
if (await afterInteract.AfterInteract(afterInteractEventArgs))
return;
}
if (target == null)
return;
@@ -718,20 +709,9 @@ namespace Content.Shared.Interaction
var activateMsg = new ActivateInWorldEvent(user, used);
RaiseLocalEvent(used, activateMsg, true);
if (activateMsg.Handled)
{
_useDelay.BeginDelay(used, delayComponent);
_adminLogger.Add(LogType.InteractActivate, LogImpact.Low, $"{ToPrettyString(user):user} activated {ToPrettyString(used):used}");
return true;
}
var activatable = AllComps<IActivate>(used).FirstOrDefault();
if (activatable == null)
if (!activateMsg.Handled)
return false;
activatable.Activate(new ActivateEventArgs(user, used));
// No way to check success.
_useDelay.BeginDelay(used, delayComponent);
_adminLogger.Add(LogType.InteractActivate, LogImpact.Low, $"{ToPrettyString(user):user} activated {ToPrettyString(used):used}");
return true;