From 5ec8e81ddbffe071794eddbf9c93d27ef24f8ef3 Mon Sep 17 00:00:00 2001 From: Vera Aguilera Puerto Date: Sun, 10 Jan 2021 16:21:09 +0100 Subject: [PATCH] Fixes syringe/injector item status volume not being updated correctly. Fixes #2843 --- .../Components/Chemistry/InjectorComponent.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Content.Server/GameObjects/Components/Chemistry/InjectorComponent.cs b/Content.Server/GameObjects/Components/Chemistry/InjectorComponent.cs index 2f59c9fad5..76fc2f8b29 100644 --- a/Content.Server/GameObjects/Components/Chemistry/InjectorComponent.cs +++ b/Content.Server/GameObjects/Components/Chemistry/InjectorComponent.cs @@ -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. /// [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(); } /// @@ -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);