Add puddles / reagent spills (#743)

This commit is contained in:
metalgearsloth
2020-04-22 04:23:12 +10:00
committed by GitHub
parent 1ba222142a
commit 60ce5b5089
53 changed files with 1143 additions and 13 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Linq;
using Content.Server.GameObjects.Components.Chemistry;
using Content.Server.GameObjects.Components.Sound;
using Content.Server.GameObjects.EntitySystems;
@@ -7,6 +8,7 @@ using Content.Shared.GameObjects.Components.Nutrition;
using Content.Shared.Interfaces;
using Content.Shared.Maths;
using Robust.Server.GameObjects;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC;
@@ -119,9 +121,12 @@ namespace Content.Server.GameObjects.Components.Nutrition
var split = _contents.SplitSolution(transferAmount);
if (stomachComponent.TryTransferSolution(split))
{
// When we split Finish gets called which may delete the can so need to use the entity system for sound
if (_useSound != null)
{
Owner.GetComponent<SoundComponent>()?.Play(_useSound);
var entitySystemManager = IoCManager.Resolve<IEntitySystemManager>();
var audioSystem = entitySystemManager.GetEntitySystem<AudioSystem>();
audioSystem.Play(_useSound);
user.PopupMessage(user, _localizationManager.GetString("Slurp"));
}
}