Defibs will now also shock anyone still interacting with the target. (#35998)
* Defibs will now also shock anyone still interacting with the target. * Improvements to test readability * Apply fixes to other tests * Refactor the interacting entities query to use an event. * Include pullers as interacting with the entity they are pulling * Broadcast event * Use a constant * Convert new test to InteractionTest * Convert existing test * Add behaviour note * Revert "Convert existing test" This reverts commit b8a8f2f68e3733bdb6ec254faf955a42096d47d7. * Move new test into separate (InteractionTest) test file * Use ToServer * Use a constant for prototype id * Use ToServer * Add EntProtoId constructor * Add assertion failure messages * Manual cleanup of test entities * Remove obsolete flag * Add test summaries * Remove tuple constructor * Wrap entity deletion in WaitPost * Extend DoAfter interacting test with an extra mob
This commit is contained in:
@@ -1465,6 +1465,18 @@ namespace Content.Shared.Interaction
|
||||
return ev.Handled;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a list of entities which are currently considered to be interacting with the specified target entity.
|
||||
/// Note: the result set is cleared on call.
|
||||
/// </summary>
|
||||
public void GetEntitiesInteractingWithTarget(EntityUid target, HashSet<EntityUid> result)
|
||||
{
|
||||
result.Clear();
|
||||
|
||||
var ev = new GetInteractingEntitiesEvent(target, result);
|
||||
RaiseLocalEvent(target, ref ev, true);
|
||||
}
|
||||
|
||||
[Obsolete("Use ActionBlockerSystem")]
|
||||
public bool SupportsComplexInteractions(EntityUid user)
|
||||
{
|
||||
@@ -1542,4 +1554,14 @@ namespace Content.Shared.Interaction
|
||||
public bool Handled;
|
||||
public bool InRange = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raised to allow systems to provide entities which are interacting with the target entity.
|
||||
/// </summary>
|
||||
[ByRefEvent]
|
||||
public record struct GetInteractingEntitiesEvent(EntityUid Target, HashSet<EntityUid> InteractingEntities)
|
||||
{
|
||||
public readonly EntityUid Target = Target;
|
||||
public HashSet<EntityUid> InteractingEntities = InteractingEntities;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user