[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:
committed by
GitHub
parent
a8aa3c1840
commit
222aaa9b59
@@ -4,7 +4,6 @@ using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.EntitySystems;
|
||||
using Content.Shared.DragDrop;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Item;
|
||||
using Content.Shared.Nutrition.EntitySystems;
|
||||
using Content.Shared.Popups;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
@@ -20,7 +19,6 @@ namespace Content.Shared.Fluids.EntitySystems;
|
||||
/// </remarks>
|
||||
/// <seealso cref="DumpableSolutionComponent" />
|
||||
/// <seealso cref="DrainableSolutionComponent" />
|
||||
/// <seealso cref="RefillableSolutionComponent" />
|
||||
public sealed class SolutionDumpingSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _protoMan = default!;
|
||||
@@ -30,8 +28,6 @@ public sealed class SolutionDumpingSystem : EntitySystem
|
||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||
[Dependency] private readonly SharedSolutionContainerSystem _solContainer = default!;
|
||||
|
||||
private EntityQuery<ItemComponent> _itemQuery;
|
||||
private EntityQuery<RefillableSolutionComponent> _refillableQuery;
|
||||
private EntityQuery<DumpableSolutionComponent> _dumpQuery;
|
||||
|
||||
public override void Initialize()
|
||||
@@ -40,21 +36,16 @@ public sealed class SolutionDumpingSystem : EntitySystem
|
||||
|
||||
SubscribeLocalEvent<DrainableSolutionComponent, CanDragEvent>(OnDrainableCanDrag);
|
||||
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<DumpableSolutionComponent, DrainedTargetEvent>(OnDrainedToDumpableDragged);
|
||||
|
||||
// We use queries for these since CanDropDraggedEvent gets called pretty rapidly
|
||||
_itemQuery = GetEntityQuery<ItemComponent>();
|
||||
_refillableQuery = GetEntityQuery<RefillableSolutionComponent>();
|
||||
_dumpQuery = GetEntityQuery<DumpableSolutionComponent>();
|
||||
}
|
||||
|
||||
private void OnDrainableCanDrag(Entity<DrainableSolutionComponent> ent, ref CanDragEvent args)
|
||||
{
|
||||
if (_itemQuery.HasComp(ent))
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -306,7 +306,7 @@ public sealed partial class StatusEffectsSystem
|
||||
/// <returns> True if duration was edited successfully, false otherwise.</returns>
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user