Refactor InRangeUnobstructed and add extension methods (#1925)
* Sort out InRangeUnobstructed and add extension methods * Rename client RangeChecks to RangeExtensions * Add container extension methods and test * Add missing component methods Component to container Grid coordinates to container Map coordinates to container Local player to container * Actually use the field * Merge fixes * Add popup argument to local player extension methods * Reduce code repetition for client range extensions
This commit is contained in:
@@ -4,6 +4,7 @@ using Content.Server.GameObjects.Components.Nutrition;
|
||||
using Content.Server.Utility;
|
||||
using Content.Shared.GameObjects.Components.Utensil;
|
||||
using Content.Shared.Interfaces.GameObjects.Components;
|
||||
using Content.Shared.Utility;
|
||||
using Robust.Server.GameObjects.EntitySystems;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -121,7 +122,7 @@ namespace Content.Server.GameObjects.Components.Utensil
|
||||
return;
|
||||
}
|
||||
|
||||
if (!InteractionChecks.InRangeUnobstructed(user, target.Transform.MapPosition))
|
||||
if (!user.InRangeUnobstructed(target, popup: true))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user