From c19c4bbb29e81b028aec68fa19c456644b55f478 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Tue, 11 Jan 2022 07:43:36 +1100 Subject: [PATCH] Plant metabolism dependency fix (#6110) --- .../ReagentEffects/PlantMetabolism/PlantAdjustAttribute.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Content.Server/Chemistry/ReagentEffects/PlantMetabolism/PlantAdjustAttribute.cs b/Content.Server/Chemistry/ReagentEffects/PlantMetabolism/PlantAdjustAttribute.cs index 83ed7eb94e..a6429094de 100644 --- a/Content.Server/Chemistry/ReagentEffects/PlantMetabolism/PlantAdjustAttribute.cs +++ b/Content.Server/Chemistry/ReagentEffects/PlantMetabolism/PlantAdjustAttribute.cs @@ -13,8 +13,6 @@ namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism [ImplicitDataDefinitionForInheritors] public abstract class PlantAdjustAttribute : ReagentEffect { - [Dependency] private readonly IRobustRandom _robustRandom = default!; - [DataField("amount")] public float Amount { get; protected set; } = 1; [DataField("prob")] public float Prob { get; protected set; } = 1; // = (80); @@ -39,7 +37,8 @@ namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism if (Prob >= 1f) return true; - return !(Prob <= 0f) && _robustRandom.Prob(Prob); + // Dependencies are never injected for reagents if you intend to do that for this. + return !(Prob <= 0f) && IoCManager.Resolve().Prob(Prob); } } }