Solution drag and drop now checks if container is closed and drainable (#34683)

drainable fix
This commit is contained in:
Łukasz Lindert
2025-04-21 17:50:07 +02:00
committed by GitHub
parent dfd0745db0
commit 04ea0b5e5a

View File

@@ -2,11 +2,14 @@ using Content.Shared.Chemistry.Components;
using Content.Shared.DragDrop;
using Content.Shared.FixedPoint;
using Content.Shared.Fluids;
using Content.Shared.Nutrition.EntitySystems;
namespace Content.Server.Fluids.EntitySystems;
public sealed partial class PuddleSystem
{
[Dependency] private readonly OpenableSystem _openable = default!;
private void InitializeTransfers()
{
SubscribeLocalEvent<RefillableSolutionComponent, DragDropDraggedEvent>(OnRefillableDragged);
@@ -32,6 +35,12 @@ public sealed partial class PuddleSystem
if (!_solutionContainerSystem.TryGetDumpableSolution((args.Target, dump, null), out var dumpableSoln, out var dumpableSolution))
return;
if (!_solutionContainerSystem.TryGetDrainableSolution(entity.Owner, out _, out _))
return;
if (_openable.IsClosed(entity))
return;
bool success = true;
if (dump.Unlimited)
{