Allow solutions to store extra reagent data (#19323)
This commit is contained in:
@@ -136,7 +136,9 @@ namespace Content.Shared.Chemistry.Reaction
|
||||
var reactantName = reactantData.Key;
|
||||
var reactantCoefficient = reactantData.Value.Amount;
|
||||
|
||||
if (!solution.TryGetReagent(reactantName, out var reactantQuantity))
|
||||
var reactantQuantity = solution.GetTotalPrototypeQuantity(reactantName);
|
||||
|
||||
if (reactantQuantity <= FixedPoint2.Zero)
|
||||
return false;
|
||||
|
||||
if (reactantData.Value.Catalyst)
|
||||
@@ -292,7 +294,7 @@ namespace Content.Shared.Chemistry.Reaction
|
||||
SortedSet<ReactionPrototype> reactions = new();
|
||||
foreach (var reactant in solution.Contents)
|
||||
{
|
||||
if (_reactions.TryGetValue(reactant.ReagentId, out var reactantReactions))
|
||||
if (_reactions.TryGetValue(reactant.Reagent.Prototype, out var reactantReactions))
|
||||
reactions.UnionWith(reactantReactions);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user