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