Refactor slip dropping to use throwing (#5476)
* Refactor slip dropping to use throwing * Update Content.Server/Fluids/EntitySystems/SpillableSystem.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Uncringe * Update Content.Server/Fluids/EntitySystems/SpillableSystem.cs Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
This commit is contained in:
@@ -3,25 +3,13 @@ using Content.Shared.Interaction;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
|
||||
namespace Content.Server.Fluids.Components
|
||||
namespace Content.Server.Fluids.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public class SpillableComponent : Component
|
||||
{
|
||||
[RegisterComponent]
|
||||
public class SpillableComponent : Component, IDropped
|
||||
{
|
||||
public override string Name => "Spillable";
|
||||
public override string Name => "Spillable";
|
||||
|
||||
[DataField("solution")]
|
||||
public string SolutionName = "puddle";
|
||||
|
||||
void IDropped.Dropped(DroppedEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.Intentional
|
||||
&& EntitySystem.Get<SolutionContainerSystem>().TryGetSolution(Owner.Uid, SolutionName, out var solutionComponent))
|
||||
{
|
||||
EntitySystem.Get<SolutionContainerSystem>()
|
||||
.Drain(Owner.Uid, solutionComponent, solutionComponent.DrainAvailable)
|
||||
.SpillAt(Owner.Transform.Coordinates, "PuddleSmear");
|
||||
}
|
||||
}
|
||||
}
|
||||
[DataField("solution")]
|
||||
public string SolutionName = "puddle";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user