Fix two interaction prediction issues (#7356)
This commit is contained in:
@@ -71,13 +71,7 @@ namespace Content.Shared.Interaction
|
||||
/// </summary>
|
||||
public EntityCoordinates ClickLocation { get; }
|
||||
|
||||
/// <summary>
|
||||
/// If true, this prediction is also being predicted client-side. So care has to be taken to avoid audio
|
||||
/// duplication.
|
||||
/// </summary>
|
||||
public bool Predicted { get; }
|
||||
|
||||
public InteractUsingEvent(EntityUid user, EntityUid used, EntityUid target, EntityCoordinates clickLocation, bool predicted = false)
|
||||
public InteractUsingEvent(EntityUid user, EntityUid used, EntityUid target, EntityCoordinates clickLocation)
|
||||
{
|
||||
// Interact using should not have the same used and target.
|
||||
// That should be a use-in-hand event instead.
|
||||
@@ -88,7 +82,6 @@ namespace Content.Shared.Interaction
|
||||
Used = used;
|
||||
Target = target;
|
||||
ClickLocation = clickLocation;
|
||||
Predicted = predicted;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -627,7 +627,6 @@ namespace Content.Shared.Interaction
|
||||
EntityUid used,
|
||||
EntityUid target,
|
||||
EntityCoordinates clickLocation,
|
||||
bool predicted = false,
|
||||
bool checkCanInteract = true,
|
||||
bool checkCanUse = true)
|
||||
{
|
||||
@@ -641,7 +640,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, predicted);
|
||||
var interactUsingEvent = new InteractUsingEvent(user, used, target, clickLocation);
|
||||
RaiseLocalEvent(target, interactUsingEvent);
|
||||
if (interactUsingEvent.Handled)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user