From 536234f2328ea2b1f5e99a7ae44c59e6d5d874dc Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Tue, 22 Feb 2022 18:01:01 +1300 Subject: [PATCH] Fix two interaction obstruction checks (#6793) --- Content.Server/RCD/Systems/RCDSystem.cs | 10 ++++++++-- .../Entities/Structures/Wallmounts/air_alarm.yml | 1 + .../Entities/Structures/Wallmounts/fire_alarm.yml | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Content.Server/RCD/Systems/RCDSystem.cs b/Content.Server/RCD/Systems/RCDSystem.cs index 1ba8471ea1..9c19afcc6b 100644 --- a/Content.Server/RCD/Systems/RCDSystem.cs +++ b/Content.Server/RCD/Systems/RCDSystem.cs @@ -161,12 +161,18 @@ namespace Content.Server.RCD.Systems } var coordinates = mapGrid.ToCoordinates(tile.GridIndices); - if (coordinates == EntityCoordinates.Invalid || - !_interactionSystem.InRangeUnobstructed(eventArgs.User, coordinates, popup: true)) + if (coordinates == EntityCoordinates.Invalid) { return false; } + var unobstructed = eventArgs.Target == null + ? _interactionSystem.InRangeUnobstructed(eventArgs.User, coordinates, popup: true) + : _interactionSystem.InRangeUnobstructed(eventArgs.User, eventArgs.Target.Value, popup: true); + + if (!unobstructed) + return false; + switch (rcd.Mode) { //Floor mode just needs the tile to be a space tile (subFloor) diff --git a/Resources/Prototypes/Entities/Structures/Wallmounts/air_alarm.yml b/Resources/Prototypes/Entities/Structures/Wallmounts/air_alarm.yml index 6dcee6b489..78c430539f 100644 --- a/Resources/Prototypes/Entities/Structures/Wallmounts/air_alarm.yml +++ b/Resources/Prototypes/Entities/Structures/Wallmounts/air_alarm.yml @@ -77,6 +77,7 @@ name: air alarm assembly description: An air alarm. Doesn't look like it'll be alarming air any time soon. components: + - type: WallMount - type: Clickable - type: InteractionOutline - type: Sprite diff --git a/Resources/Prototypes/Entities/Structures/Wallmounts/fire_alarm.yml b/Resources/Prototypes/Entities/Structures/Wallmounts/fire_alarm.yml index 942f3c31be..8145c1cfc0 100644 --- a/Resources/Prototypes/Entities/Structures/Wallmounts/fire_alarm.yml +++ b/Resources/Prototypes/Entities/Structures/Wallmounts/fire_alarm.yml @@ -61,6 +61,7 @@ name: fire alarm assembly description: A fire alarm assembly. Very mild. components: + - type: WallMount - type: Clickable - type: InteractionOutline - type: Sprite