Minor spill refactors (#5569)

This commit is contained in:
Ygg01
2021-12-05 04:18:30 +01:00
committed by GitHub
parent 5d63411113
commit d1ab9592aa
12 changed files with 248 additions and 253 deletions

View File

@@ -1,5 +1,6 @@
using Content.Server.Chemistry.EntitySystems;
using Content.Server.Fluids.Components;
using Content.Server.Fluids.EntitySystems;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -20,10 +21,10 @@ namespace Content.Server.Destructible.Thresholds.Behaviors
/// </summary>
/// <param name="owner">Entity on which behavior is executed</param>
/// <param name="system">system calling the behavior</param>
/// <param name="entityManager"></param>
public void Execute(EntityUid owner, DestructibleSystem system)
{
var solutionContainerSystem = EntitySystem.Get<SolutionContainerSystem>();
var spillableSystem = EntitySystem.Get<SpillableSystem>();
var coordinates = system.EntityManager.GetComponent<TransformComponent>(owner).Coordinates;
@@ -31,12 +32,12 @@ namespace Content.Server.Destructible.Thresholds.Behaviors
solutionContainerSystem.TryGetSolution(owner, spillableComponent.SolutionName,
out var compSolution))
{
compSolution.SpillAt(coordinates, "PuddleSmear", false);
spillableSystem.SpillAt(compSolution, coordinates, "PuddleSmear", false);
}
else if (Solution != null &&
solutionContainerSystem.TryGetSolution(owner, Solution, out var behaviorSolution))
{
behaviorSolution.SpillAt(coordinates, "PuddleSmear", false);
spillableSystem.SpillAt(behaviorSolution, coordinates, "PuddleSmear", false);
}
}
}