Fold Produce's "produce" solution into the "food" solution to fix empty food (#4837)

One of these was going to have to be folded into the other for it to work.
I am starting to really hate this refactor.
Note that this might still leave smokable tampering broken if it was already broken, but it shouldn't break it if it wasn't.

TESTED: Grown apples, carrots, something I forgot, bananas, *client crash due to slipping*
This commit is contained in:
20kdc
2021-10-12 09:01:23 +01:00
committed by GitHub
parent 7154e971f8
commit e144bb53f5
3 changed files with 8 additions and 8 deletions

View File

@@ -16,7 +16,7 @@ namespace Content.Server.Botany.Components
public class ProduceComponent : Component, ISerializationHooks
{
public override string Name => "Produce";
public const string SolutionName = "produce";
[DataField("targetSolution")] public string SolutionName { get; set; } = "food";
[DataField("seed")] private string? _seedName;
@@ -40,7 +40,6 @@ namespace Content.Server.Botany.Components
sprite.LayerSetState(0, Seed.PlantIconState);
}
EntitySystem.Get<SolutionContainerSystem>().RemoveAllSolution(Owner.Uid);
var solutionContainer = EntitySystem.Get<SolutionContainerSystem>().EnsureSolution(Owner, SolutionName);
if (solutionContainer == null)
{
@@ -48,6 +47,7 @@ namespace Content.Server.Botany.Components
return;
}
solutionContainer.RemoveAllSolution();
foreach (var (chem, quantity) in Seed.Chemicals)
{
var amount = ReagentUnit.New(quantity.Min);