Fixes syringe/injector item status volume not being updated correctly.

Fixes #2843
This commit is contained in:
Vera Aguilera Puerto
2021-01-10 16:21:09 +01:00
parent 07776358eb
commit 5ec8e81ddb

View File

@@ -4,6 +4,7 @@ using System.Threading.Tasks;
using Content.Server.GameObjects.Components.Body.Circulatory;
using Content.Shared.Chemistry;
using Content.Shared.GameObjects.Components.Chemistry;
using Content.Shared.GameObjects.EntitySystems;
using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Content.Shared.Utility;
@@ -23,7 +24,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
/// containers, and can directly inject into a mobs bloodstream.
/// </summary>
[RegisterComponent]
public class InjectorComponent : SharedInjectorComponent, IAfterInteract, IUse
public class InjectorComponent : SharedInjectorComponent, IAfterInteract, IUse, ISolutionChange
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
@@ -71,6 +72,8 @@ namespace Content.Server.GameObjects.Components.Chemistry
// Set _toggleState based on prototype
_toggleState = _injectOnly ? InjectorToggleMode.Inject : InjectorToggleMode.Draw;
Dirty();
}
/// <summary>
@@ -280,6 +283,11 @@ namespace Content.Server.GameObjects.Components.Chemistry
Dirty();
}
public void SolutionChanged(SolutionChangeEventArgs eventArgs)
{
Dirty();
}
public override ComponentState GetComponentState()
{
Owner.TryGetComponent(out SolutionContainerComponent? solution);