Allow solutions to store extra reagent data (#19323)

This commit is contained in:
Leon Friedrich
2023-09-05 09:55:10 +12:00
committed by GitHub
parent a6b81058d0
commit e4ca6f4fb9
52 changed files with 932 additions and 538 deletions

View File

@@ -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;
}