Plant metabolism dependency fix (#6110)
This commit is contained in:
@@ -13,8 +13,6 @@ namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism
|
|||||||
[ImplicitDataDefinitionForInheritors]
|
[ImplicitDataDefinitionForInheritors]
|
||||||
public abstract class PlantAdjustAttribute : ReagentEffect
|
public abstract class PlantAdjustAttribute : ReagentEffect
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
|
||||||
|
|
||||||
[DataField("amount")] public float Amount { get; protected set; } = 1;
|
[DataField("amount")] public float Amount { get; protected set; } = 1;
|
||||||
[DataField("prob")] public float Prob { get; protected set; } = 1; // = (80);
|
[DataField("prob")] public float Prob { get; protected set; } = 1; // = (80);
|
||||||
|
|
||||||
@@ -39,7 +37,8 @@ namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism
|
|||||||
if (Prob >= 1f)
|
if (Prob >= 1f)
|
||||||
return true;
|
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<IRobustRandom>().Prob(Prob);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user