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

@@ -110,11 +110,13 @@ public sealed class PricingSystem : EntitySystem
foreach (var solution in component.Solutions.Values)
{
foreach (var reagent in solution.Contents)
foreach (var (reagent, quantity) in solution.Contents)
{
if (!_prototypeManager.TryIndex<ReagentPrototype>(reagent.ReagentId, out var reagentProto))
if (!_prototypeManager.TryIndex<ReagentPrototype>(reagent.Prototype, out var reagentProto))
continue;
price += (float) reagent.Quantity * reagentProto.PricePerUnit;
// TODO check ReagentData for price information?
price += (float) quantity * reagentProto.PricePerUnit;
}
}