Predict inventory slot interactions. (#6033)

This commit is contained in:
Leon Friedrich
2022-01-30 13:50:10 +13:00
committed by GitHub
parent c465715273
commit 47e597ca47
9 changed files with 138 additions and 140 deletions

View File

@@ -532,7 +532,7 @@ namespace Content.Shared.Interaction
/// Finds components with the InteractUsing interface and calls their function
/// NOTE: Does not have an InRangeUnobstructed check
/// </summary>
public async Task InteractUsing(EntityUid user, EntityUid used, EntityUid target, EntityCoordinates clickLocation)
public async Task InteractUsing(EntityUid user, EntityUid used, EntityUid target, EntityCoordinates clickLocation, bool predicted = false)
{
if (!_actionBlockerSystem.CanInteract(user))
return;
@@ -541,7 +541,7 @@ namespace Content.Shared.Interaction
return;
// all interactions should only happen when in range / unobstructed, so no range check is needed
var interactUsingEvent = new InteractUsingEvent(user, used, target, clickLocation);
var interactUsingEvent = new InteractUsingEvent(user, used, target, clickLocation, predicted);
RaiseLocalEvent(target, interactUsingEvent);
if (interactUsingEvent.Handled)
return;