]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix dragon devour action (#37968)
authordeltanedas <39013340+deltanedas@users.noreply.github.com>
Sat, 31 May 2025 20:29:51 +0000 (20:29 +0000)
committerGitHub <noreply@github.com>
Sat, 31 May 2025 20:29:51 +0000 (22:29 +0200)
Co-authored-by: deltanedas <@deltanedas:kde.org>
Content.Shared/Actions/SharedActionsSystem.cs
Resources/Prototypes/Entities/Mobs/Player/dragon.yml

index 948d655d4a29a2a5e1eb4f236a38b1715f10afef..583bd177dcebc40927b5768aa8df14525432350e 100644 (file)
@@ -417,15 +417,13 @@ public abstract class SharedActionsSystem : EntitySystem
             return comp.CanTargetSelf;
 
         var targetAction = Comp<TargetActionComponent>(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<WorldTargetActionComponent> ent)
@@ -436,7 +434,7 @@ public abstract class SharedActionsSystem : EntitySystem
 
     private bool ValidateBaseTarget(EntityUid user, EntityCoordinates coords, Entity<TargetActionComponent> ent)
     {
-        var (uid, comp) = ent;
+        var comp = ent.Comp;
         if (comp.CheckCanAccess)
             return _interaction.InRangeUnobstructed(user, coords, range: comp.Range);
 
index f3332ef0c515716586a3fcbe01bb15cd03a17b62..7ba6acf50dc7389184a705d923f79f59c66ccf11 100644 (file)
   - 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