Adjust interaction ordering & interaction conditions (#6387)

This commit is contained in:
Leon Friedrich
2022-02-05 15:39:01 +13:00
committed by GitHub
parent 442d7dbf8e
commit dd61fb46ea
28 changed files with 88 additions and 167 deletions

View File

@@ -234,10 +234,10 @@ namespace Content.Server.Interaction
/// Finds components with the InteractHand interface and calls their function
/// NOTE: Does not have an InRangeUnobstructed check
/// </summary>
public override void InteractHand(EntityUid user, EntityUid target)
public override void InteractHand(EntityUid user, EntityUid target, bool checkActionBlocker = true)
{
// TODO PREDICTION move server-side interaction logic into the shared system for interaction prediction.
if (!_actionBlockerSystem.CanInteract(user))
if (checkActionBlocker && !_actionBlockerSystem.CanInteract(user))
return;
// all interactions should only happen when in range / unobstructed, so no range check is needed
@@ -270,7 +270,7 @@ namespace Content.Server.Interaction
public override async Task<bool> InteractUsingRanged(EntityUid user, EntityUid used, EntityUid? target, EntityCoordinates clickLocation, bool inRangeUnobstructed)
{
// TODO PREDICTION move server-side interaction logic into the shared system for interaction prediction.
if (InteractDoBefore(user, used, inRangeUnobstructed ? target : null, clickLocation, false))
if (InteractDoBefore(user, used, target, clickLocation, inRangeUnobstructed))
return true;
if (target != null)
@@ -282,7 +282,7 @@ namespace Content.Server.Interaction
return true;
}
return await InteractDoAfter(user, used, inRangeUnobstructed ? target : null, clickLocation, false);
return await InteractDoAfter(user, used, target, clickLocation, inRangeUnobstructed);
}
public override void DoAttack(EntityUid user, EntityCoordinates coordinates, bool wideAttack, EntityUid? target = null)