Add puddles / reagent spills (#743)
This commit is contained in:
@@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user