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

@@ -798,7 +798,7 @@ namespace Content.Server.Botany.Components
return DoHarvest(user);
}
if (usingItem.HasComponent<ProduceComponent>())
if (usingItem.TryGetComponent<ProduceComponent>(out var produce))
{
user.PopupMessageCursor(Loc.GetString("plant-holder-component-compost-message",
("owner", Owner),
@@ -808,7 +808,7 @@ namespace Content.Server.Botany.Components
("usingItem", usingItem),
("owner", Owner)));
if (solutionSystem.TryGetSolution(usingItem, ProduceComponent.SolutionName, out var solution2))
if (solutionSystem.TryGetSolution(usingItem, produce.SolutionName, out var solution2))
{
// This deliberately discards overfill.
solutionSystem.TryAddSolution(usingItem.Uid, solution2,