Revs (the spooky ones) (#9842)

This commit is contained in:
Nemanja
2022-08-13 09:49:41 -04:00
committed by GitHub
parent ab4e2ef74f
commit 3e1cf73469
68 changed files with 1976 additions and 34 deletions

View File

@@ -36,4 +36,23 @@ namespace Content.Shared.Interaction
Target = target;
}
}
public sealed class InteractNoHandEvent : HandledEntityEventArgs, ITargetedInteractEventArgs
{
/// <summary>
/// Entity that triggered the interaction.
/// </summary>
public EntityUid User { get; }
/// <summary>
/// Entity that was interacted on.
/// </summary>
public EntityUid Target { get; }
public InteractNoHandEvent(EntityUid user, EntityUid target)
{
User = user;
Target = target;
}
}
}

View File

@@ -230,7 +230,14 @@ namespace Content.Shared.Interaction
// Does the user have hands?
if (!TryComp(user, out SharedHandsComponent? hands) || hands.ActiveHand == null)
{
if (target != null)
{
var ev = new InteractNoHandEvent(user, target.Value);
RaiseLocalEvent(user, ev, true);
}
return;
}
var inRangeUnobstructed = target == null
? !checkAccess || InRangeUnobstructed(user, coordinates)