[STAGING/HOTFIX] Butcher entities in containers. (#40299)

* Kitchen spike and sharp system

* Use transform and parent

* A

* Works

* A

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
Princess Cheeseballs
2025-09-14 13:41:42 -07:00
committed by GitHub
parent 9e204c3023
commit d8e818283c
4 changed files with 58 additions and 27 deletions

View File

@@ -1303,10 +1303,17 @@ namespace Content.Shared.Interaction
var ev = new AccessibleOverrideEvent(user, target);
RaiseLocalEvent(user, ref ev);
RaiseLocalEvent(target, ref ev);
// If either has handled it and neither has said we can't access it then we can access it.
if (ev.Handled)
return ev.Accessible;
return CanAccess(user, target);
}
public bool CanAccess(EntityUid user, EntityUid target)
{
if (_containerSystem.IsInSameOrParentContainer(user, target, out _, out var container))
return true;
@@ -1511,16 +1518,16 @@ namespace Content.Shared.Interaction
/// <summary>
/// Override event raised directed on the user to say the target is accessible.
/// </summary>
/// <param name="User"></param>
/// <param name="Target"></param>
/// <param name="Target">Entity we're targeting</param>
[ByRefEvent]
public record struct AccessibleOverrideEvent(EntityUid User, EntityUid Target)
{
public readonly EntityUid User = User;
public readonly EntityUid Target = Target;
// We set it to true by default for easier validation later.
public bool Handled;
public bool Accessible = false;
public bool Accessible;
}
/// <summary>