fix: fix non-access checking EntityTargetActions (#38731)
This commit is contained in:
@@ -417,13 +417,18 @@ public abstract class SharedActionsSystem : EntitySystem
|
||||
return comp.CanTargetSelf;
|
||||
|
||||
var targetAction = Comp<TargetActionComponent>(uid);
|
||||
|
||||
// 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, targetAction.Range, targetAction.AccessMask);
|
||||
|
||||
// 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);
|
||||
// Just check normal in range, allowing <= 0 range to mean infinite range.
|
||||
if (targetAction.Range > 0
|
||||
&& !_transform.InRange(user, target, targetAction.Range))
|
||||
return false;
|
||||
|
||||
// If checkCanAccess isn't set, we allow targeting things in containers
|
||||
return _interaction.IsAccessible(user, target);
|
||||
}
|
||||
|
||||
public bool ValidateWorldTarget(EntityUid user, EntityCoordinates target, Entity<WorldTargetActionComponent> ent)
|
||||
|
||||
Reference in New Issue
Block a user