ActSystem and Destruction Threshold Behaviors use EntityUid.

This commit is contained in:
Vera Aguilera Puerto
2021-11-09 12:06:00 +01:00
parent c5fda6daca
commit 5cec5c421c
14 changed files with 44 additions and 42 deletions

View File

@@ -20,21 +20,23 @@ 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>
public void Execute(IEntity owner, DestructibleSystem system)
/// <param name="entityManager"></param>
public void Execute(EntityUid owner, DestructibleSystem system, IEntityManager entityManager)
{
var solutionContainerSystem = EntitySystem.Get<SolutionContainerSystem>();
var coordinates = entityManager.GetComponent<TransformComponent>(owner).Coordinates;
if (owner.TryGetComponent(out SpillableComponent? spillableComponent) &&
solutionContainerSystem.TryGetSolution(owner.Uid, spillableComponent.SolutionName,
if (entityManager.TryGetComponent(owner, out SpillableComponent? spillableComponent) &&
solutionContainerSystem.TryGetSolution(owner, spillableComponent.SolutionName,
out var compSolution))
{
compSolution.SpillAt(owner.Transform.Coordinates, "PuddleSmear", false);
compSolution.SpillAt(coordinates, "PuddleSmear", false);
}
else if (Solution != null &&
solutionContainerSystem.TryGetSolution(owner.Uid, Solution, out var behaviorSolution))
solutionContainerSystem.TryGetSolution(owner, Solution, out var behaviorSolution))
{
behaviorSolution.SpillAt(owner.Transform.Coordinates, "PuddleSmear", false);
behaviorSolution.SpillAt(coordinates, "PuddleSmear", false);
}
}
}