DrinkSystem uses EntityUid instead of IEntity

This commit is contained in:
Vera Aguilera Puerto
2021-11-09 11:28:27 +01:00
parent 0220551f72
commit 1a177f7479
12 changed files with 71 additions and 32 deletions

View File

@@ -13,6 +13,7 @@ using Robust.Shared.Map;
namespace Content.Server.Fluids.Components
{
// TODO: Kill these with fire
public static class SpillExtensions
{
/// <summary>
@@ -31,6 +32,25 @@ namespace Content.Server.Fluids.Components
return solution.SpillAt(entity.Transform.Coordinates, prototype, sound);
}
/// <summary>
/// Spills the specified solution at the entity's location if possible.
/// </summary>
/// <param name="entity">
/// The entity to use as a location to spill the solution at.
/// </param>
/// <param name="solution">Initial solution for the prototype.</param>
/// <param name="prototype">The prototype to use.</param>
/// <param name="sound">Play the spill sound.</param>
/// <param name="entityManager"></param>
/// <returns>The puddle if one was created, null otherwise.</returns>
public static PuddleComponent? SpillAt(this Solution solution, EntityUid entity, string prototype,
bool sound = true, IEntityManager? entityManager = null)
{
entityManager ??= IoCManager.Resolve<IEntityManager>();
return solution.SpillAt(entityManager.GetComponent<TransformComponent>(entity).Coordinates, prototype, sound);
}
/// <summary>
/// Spills the specified solution at the entity's location if possible.
/// </summary>