diff --git a/Content.Shared/Actions/SharedActionsSystem.cs b/Content.Shared/Actions/SharedActionsSystem.cs index 948d655d4a..583bd177dc 100644 --- a/Content.Shared/Actions/SharedActionsSystem.cs +++ b/Content.Shared/Actions/SharedActionsSystem.cs @@ -417,15 +417,13 @@ public abstract class SharedActionsSystem : EntitySystem return comp.CanTargetSelf; var targetAction = Comp(uid); - var coords = Transform(target).Coordinates; - if (!ValidateBaseTarget(user, coords, (uid, targetAction))) - { - // if not just checking pure range, let stored entities be targeted by actions - // if it's out of range it probably isn't stored anyway... - return targetAction.CheckCanAccess && _interaction.CanAccessViaStorage(user, target); - } + // not using the ValidateBaseTarget logic since its raycast fails if the target is e.g. a wall + if (targetAction.CheckCanAccess) + return _interaction.InRangeAndAccessible(user, target, range: targetAction.Range); - return _interaction.InRangeAndAccessible(user, target, range: targetAction.Range); + // if not just checking pure range, let stored entities be targeted by actions + // if it's out of range it probably isn't stored anyway... + return _interaction.CanAccessViaStorage(user, target); } public bool ValidateWorldTarget(EntityUid user, EntityCoordinates target, Entity ent) @@ -436,7 +434,7 @@ public abstract class SharedActionsSystem : EntitySystem private bool ValidateBaseTarget(EntityUid user, EntityCoordinates coords, Entity ent) { - var (uid, comp) = ent; + var comp = ent.Comp; if (comp.CheckCanAccess) return _interaction.InRangeUnobstructed(user, coords, range: comp.Range); diff --git a/Resources/Prototypes/Entities/Mobs/Player/dragon.yml b/Resources/Prototypes/Entities/Mobs/Player/dragon.yml index f3332ef0c5..7ba6acf50d 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/dragon.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/dragon.yml @@ -253,9 +253,17 @@ - type: Action icon: { sprite : Interface/Actions/devour.rsi, state: icon } iconOn: { sprite : Interface/Actions/devour.rsi, state: icon-on } + itemIconStyle: BigAction priority: 1 - type: TargetAction - type: EntityTargetAction + canTargetSelf: false + whitelist: + components: + - MobState + - Door + tags: + - Wall event: !type:DevourActionEvent - type: entity