diff --git a/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs index f3c30211e4..745510e850 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs @@ -87,7 +87,7 @@ namespace Content.Server.GameObjects var itemPos = Owner.Transform.WorldPosition; return _entitySystemManager.GetEntitySystem() - .InRangeUnobstructed(userPos, itemPos, ignoredEnt: Owner); + .InRangeUnobstructed(userPos, itemPos, ignoredEnt: Owner, insideBlockerValid:true); } public bool AttackHand(AttackHandEventArgs eventArgs) diff --git a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs index 08daa1fdb8..6ed819e814 100644 --- a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs @@ -279,9 +279,10 @@ namespace Content.Server.GameObjects.EntitySystems /// the mask to check for collisions /// the entity to be ignored when checking for collisions. /// Map manager containing the two GridIds. + /// if coordinates inside obstructions count as obstructed or not /// True if the two points are within a given range without being obstructed. public bool InRangeUnobstructed(MapCoordinates coords, Vector2 otherCoords, float range = InteractionRange, - int collisionMask = (int) CollisionGroup.Impassable, IEntity ignoredEnt = null) + int collisionMask = (int) CollisionGroup.Impassable, IEntity ignoredEnt = null, bool insideBlockerValid = false) { var dir = otherCoords - coords.Position; @@ -294,7 +295,9 @@ namespace Content.Server.GameObjects.EntitySystems var ray = new CollisionRay(coords.Position, dir.Normalized, collisionMask); var rayResults = _physicsManager.IntersectRay(coords.MapId, ray, dir.Length, ignoredEnt, true); - return !rayResults.DidHitObject; + + + return !rayResults.DidHitObject || (insideBlockerValid && rayResults.DidHitObject && rayResults.Distance < 1f); } private bool HandleActivateItemInWorld(ICommonSession session, GridCoordinates coords, EntityUid uid)