[HOTFIX] Fix status effect removal from entity effects and buckets not being draggable (#41168)

just do less work it's that easy!

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
Princess Cheeseballs
2025-10-28 11:31:53 -07:00
committed by GitHub
parent a8aa3c1840
commit 222aaa9b59
2 changed files with 2 additions and 11 deletions

View File

@@ -4,7 +4,6 @@ using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.DragDrop; using Content.Shared.DragDrop;
using Content.Shared.FixedPoint; using Content.Shared.FixedPoint;
using Content.Shared.Item;
using Content.Shared.Nutrition.EntitySystems; using Content.Shared.Nutrition.EntitySystems;
using Content.Shared.Popups; using Content.Shared.Popups;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;
@@ -20,7 +19,6 @@ namespace Content.Shared.Fluids.EntitySystems;
/// </remarks> /// </remarks>
/// <seealso cref="DumpableSolutionComponent" /> /// <seealso cref="DumpableSolutionComponent" />
/// <seealso cref="DrainableSolutionComponent" /> /// <seealso cref="DrainableSolutionComponent" />
/// <seealso cref="RefillableSolutionComponent" />
public sealed class SolutionDumpingSystem : EntitySystem public sealed class SolutionDumpingSystem : EntitySystem
{ {
[Dependency] private readonly IPrototypeManager _protoMan = default!; [Dependency] private readonly IPrototypeManager _protoMan = default!;
@@ -30,8 +28,6 @@ public sealed class SolutionDumpingSystem : EntitySystem
[Dependency] private readonly SharedPopupSystem _popup = default!; [Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedSolutionContainerSystem _solContainer = default!; [Dependency] private readonly SharedSolutionContainerSystem _solContainer = default!;
private EntityQuery<ItemComponent> _itemQuery;
private EntityQuery<RefillableSolutionComponent> _refillableQuery;
private EntityQuery<DumpableSolutionComponent> _dumpQuery; private EntityQuery<DumpableSolutionComponent> _dumpQuery;
public override void Initialize() public override void Initialize()
@@ -40,21 +36,16 @@ public sealed class SolutionDumpingSystem : EntitySystem
SubscribeLocalEvent<DrainableSolutionComponent, CanDragEvent>(OnDrainableCanDrag); SubscribeLocalEvent<DrainableSolutionComponent, CanDragEvent>(OnDrainableCanDrag);
SubscribeLocalEvent<DrainableSolutionComponent, CanDropDraggedEvent>(OnDrainableCanDragDropped); SubscribeLocalEvent<DrainableSolutionComponent, CanDropDraggedEvent>(OnDrainableCanDragDropped);
//SubscribeLocalEvent<RefillableSolutionComponent, DragDropDraggedEvent>(OnRefillableDragged); For if you want to refill a container by dragging it into another one. Can't find a use for that currently.
SubscribeLocalEvent<DrainableSolutionComponent, DragDropDraggedEvent>(OnDrainableDragged); SubscribeLocalEvent<DrainableSolutionComponent, DragDropDraggedEvent>(OnDrainableDragged);
SubscribeLocalEvent<DumpableSolutionComponent, DrainedTargetEvent>(OnDrainedToDumpableDragged); SubscribeLocalEvent<DumpableSolutionComponent, DrainedTargetEvent>(OnDrainedToDumpableDragged);
// We use queries for these since CanDropDraggedEvent gets called pretty rapidly // We use queries for these since CanDropDraggedEvent gets called pretty rapidly
_itemQuery = GetEntityQuery<ItemComponent>();
_refillableQuery = GetEntityQuery<RefillableSolutionComponent>();
_dumpQuery = GetEntityQuery<DumpableSolutionComponent>(); _dumpQuery = GetEntityQuery<DumpableSolutionComponent>();
} }
private void OnDrainableCanDrag(Entity<DrainableSolutionComponent> ent, ref CanDragEvent args) private void OnDrainableCanDrag(Entity<DrainableSolutionComponent> ent, ref CanDragEvent args)
{ {
if (_itemQuery.HasComp(ent))
args.Handled = true; args.Handled = true;
} }

View File

@@ -306,7 +306,7 @@ public sealed partial class StatusEffectsSystem
/// <returns> True if duration was edited successfully, false otherwise.</returns> /// <returns> True if duration was edited successfully, false otherwise.</returns>
public bool TryRemoveTime(EntityUid uid, EntProtoId effectProto, TimeSpan? time) public bool TryRemoveTime(EntityUid uid, EntProtoId effectProto, TimeSpan? time)
{ {
return time == null ? TryRemoveStatusEffect(uid, effectProto) : TryAddTime(uid, effectProto, time.Value); return time == null ? TryRemoveStatusEffect(uid, effectProto) : TryAddTime(uid, effectProto, - time.Value);
} }
/// <summary> /// <summary>