Allow solutions to store extra reagent data (#19323)
This commit is contained in:
@@ -19,6 +19,7 @@ namespace Content.Server.Chemistry.ReagentEffectConditions
|
||||
[DataField("max")]
|
||||
public FixedPoint2 Max = FixedPoint2.MaxValue;
|
||||
|
||||
// TODO use ReagentId
|
||||
[DataField("reagent")]
|
||||
public string? Reagent;
|
||||
|
||||
@@ -29,10 +30,8 @@ namespace Content.Server.Chemistry.ReagentEffectConditions
|
||||
return true; // No condition to apply.
|
||||
|
||||
var quant = FixedPoint2.Zero;
|
||||
if (args.Source != null && args.Source.ContainsReagent(reagent))
|
||||
{
|
||||
quant = args.Source.GetReagentQuantity(reagent);
|
||||
}
|
||||
if (args.Source != null)
|
||||
quant = args.Source.GetTotalPrototypeQuantity(reagent);
|
||||
|
||||
return quant >= Min && quant <= Max;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user