From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Sun, 11 Aug 2024 02:28:07 +0000 (+1000) Subject: Add some container checks (#30896) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=d7c3ba84094c2814617481c4bd7813e0defc13f9;p=space-station-14.git Add some container checks (#30896) Climbable container probably getting checked up the callstack so just check these ones. --- diff --git a/Content.Shared/Climbing/Systems/ClimbSystem.cs b/Content.Shared/Climbing/Systems/ClimbSystem.cs index 635bf36049..9b77d039f4 100644 --- a/Content.Shared/Climbing/Systems/ClimbSystem.cs +++ b/Content.Shared/Climbing/Systems/ClimbSystem.cs @@ -14,6 +14,7 @@ using Content.Shared.Popups; using Content.Shared.Stunnable; using Content.Shared.Verbs; using Robust.Shared.Audio.Systems; +using Robust.Shared.Containers; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision.Shapes; using Robust.Shared.Physics.Components; @@ -34,6 +35,7 @@ public sealed partial class ClimbSystem : VirtualController [Dependency] private readonly FixtureSystem _fixtureSystem = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!; + [Dependency] private readonly SharedContainerSystem _containers = default!; [Dependency] private readonly SharedInteractionSystem _interactionSystem = default!; [Dependency] private readonly SharedPopupSystem _popupSystem = default!; [Dependency] private readonly SharedPhysicsSystem _physics = default!; @@ -450,6 +452,12 @@ public sealed partial class ClimbSystem : VirtualController return false; } + if (_containers.IsEntityInContainer(user)) + { + reason = Loc.GetString("comp-climbable-cant-reach"); + return false; + } + reason = string.Empty; return true; } @@ -487,6 +495,12 @@ public sealed partial class ClimbSystem : VirtualController return false; } + if (_containers.IsEntityInContainer(user) || _containers.IsEntityInContainer(dragged)) + { + reason = Loc.GetString("comp-climbable-cant-reach"); + return false; + } + reason = string.Empty; return true; }