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;
|
return comp.CanTargetSelf;
|
||||||
|
|
||||||
var targetAction = Comp<TargetActionComponent>(uid);
|
var targetAction = Comp<TargetActionComponent>(uid);
|
||||||
var coords = Transform(target).Coordinates;
|
// not using the ValidateBaseTarget logic since its raycast fails if the target is e.g. a wall
|
||||||
if (!ValidateBaseTarget(user, coords, (uid, targetAction)))
|
if (targetAction.CheckCanAccess)
|
||||||
{
|
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 targetAction.CheckCanAccess && _interaction.CanAccessViaStorage(user, target);
|
|
||||||
}
|
|
||||||
|
|
||||||
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)
|
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)
|
private bool ValidateBaseTarget(EntityUid user, EntityCoordinates coords, Entity<TargetActionComponent> ent)
|
||||||
{
|
{
|
||||||
var (uid, comp) = ent;
|
var comp = ent.Comp;
|
||||||
if (comp.CheckCanAccess)
|
if (comp.CheckCanAccess)
|
||||||
return _interaction.InRangeUnobstructed(user, coords, range: comp.Range);
|
return _interaction.InRangeUnobstructed(user, coords, range: comp.Range);
|
||||||
|
|
||||||
|
|||||||
@@ -253,9 +253,17 @@
|
|||||||
- type: Action
|
- type: Action
|
||||||
icon: { sprite : Interface/Actions/devour.rsi, state: icon }
|
icon: { sprite : Interface/Actions/devour.rsi, state: icon }
|
||||||
iconOn: { sprite : Interface/Actions/devour.rsi, state: icon-on }
|
iconOn: { sprite : Interface/Actions/devour.rsi, state: icon-on }
|
||||||
|
itemIconStyle: BigAction
|
||||||
priority: 1
|
priority: 1
|
||||||
- type: TargetAction
|
- type: TargetAction
|
||||||
- type: EntityTargetAction
|
- type: EntityTargetAction
|
||||||
|
canTargetSelf: false
|
||||||
|
whitelist:
|
||||||
|
components:
|
||||||
|
- MobState
|
||||||
|
- Door
|
||||||
|
tags:
|
||||||
|
- Wall
|
||||||
event: !type:DevourActionEvent
|
event: !type:DevourActionEvent
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
|
|||||||
Reference in New Issue
Block a user