FoodComponent solution un-hardcoding, rehydratable solution name fixes, monkey cubes edible again, slicable food preserves poisons (#4942)

This commit is contained in:
20kdc
2021-10-19 08:13:43 +01:00
committed by GitHub
parent eae8ab96d8
commit 6c6bde8743
8 changed files with 38 additions and 14 deletions

View File

@@ -12,6 +12,9 @@ namespace Content.Server.Chemistry.ReagentEntityReactions
[UsedImplicitly]
public class AddToSolutionReaction : ReagentEntityReaction
{
[DataField("solution")]
private string _solution = "reagents";
[DataField("reagents", true, customTypeSerializer: typeof(PrototypeIdHashSetSerializer<ReagentPrototype>))]
// ReSharper disable once CollectionNeverUpdated.Local
private readonly HashSet<string> _reagents = new();
@@ -20,7 +23,7 @@ namespace Content.Server.Chemistry.ReagentEntityReactions
{
// TODO see if this is correct
if (!EntitySystem.Get<SolutionContainerSystem>()
.TryGetSolution(entity, "reagents", out var solutionContainer)
.TryGetSolution(entity, _solution, out var solutionContainer)
|| (_reagents.Count > 0 && !_reagents.Contains(reagent.ID))) return;
if (EntitySystem.Get<SolutionContainerSystem>()