Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Content.Server/Fluids/EntitySystems/PuddleSystem.Transfers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
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);
Expand All @@ -26,6 +29,12 @@ private void OnRefillableDragged(Entity<RefillableSolutionComponent> entity, ref
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)
{
Expand Down
Loading