fix dragon devour action (#37968)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user