Fix two interaction obstruction checks (#6793)

This commit is contained in:
Leon Friedrich
2022-02-22 18:01:01 +13:00
committed by GitHub
parent 4a68718050
commit 536234f232
3 changed files with 10 additions and 2 deletions

View File

@@ -161,12 +161,18 @@ namespace Content.Server.RCD.Systems
} }
var coordinates = mapGrid.ToCoordinates(tile.GridIndices); var coordinates = mapGrid.ToCoordinates(tile.GridIndices);
if (coordinates == EntityCoordinates.Invalid || if (coordinates == EntityCoordinates.Invalid)
!_interactionSystem.InRangeUnobstructed(eventArgs.User, coordinates, popup: true))
{ {
return false; 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) switch (rcd.Mode)
{ {
//Floor mode just needs the tile to be a space tile (subFloor) //Floor mode just needs the tile to be a space tile (subFloor)

View File

@@ -77,6 +77,7 @@
name: air alarm assembly name: air alarm assembly
description: An air alarm. Doesn't look like it'll be alarming air any time soon. description: An air alarm. Doesn't look like it'll be alarming air any time soon.
components: components:
- type: WallMount
- type: Clickable - type: Clickable
- type: InteractionOutline - type: InteractionOutline
- type: Sprite - type: Sprite

View File

@@ -61,6 +61,7 @@
name: fire alarm assembly name: fire alarm assembly
description: A fire alarm assembly. Very mild. description: A fire alarm assembly. Very mild.
components: components:
- type: WallMount
- type: Clickable - type: Clickable
- type: InteractionOutline - type: InteractionOutline
- type: Sprite - type: Sprite