Uranium is now edible! (#15952)

This commit is contained in:
Tunguso4ka
2023-05-06 10:23:05 +03:00
committed by GitHub
parent a93d70e614
commit ce867724a7
5 changed files with 36 additions and 12 deletions

View File

@@ -4,6 +4,7 @@ using Content.Server.Body.Systems;
using Content.Server.Chemistry.EntitySystems;
using Content.Server.Nutrition.Components;
using Content.Server.Popups;
using Content.Server.Stack;
using Content.Shared.Administration.Logs;
using Content.Shared.Body.Components;
using Content.Shared.Body.Organ;
@@ -22,6 +23,7 @@ using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Nutrition;
using Content.Shared.Verbs;
using Content.Shared.Stacks;
using Robust.Shared.Audio;
using Robust.Shared.Player;
using Robust.Shared.Utility;
@@ -47,6 +49,7 @@ namespace Content.Server.Nutrition.EntitySystems
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
[Dependency] private readonly ReactiveSystem _reaction = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly StackSystem _stack = default!;
public override void Initialize()
{
@@ -260,7 +263,19 @@ namespace Content.Server.Nutrition.EntitySystems
_utensilSystem.TryBreak(utensil, args.User);
}
if (component.UsesRemaining > 0)
args.Repeat = !forceFeed;
if (TryComp<StackComponent>(uid, out var stack))
{
//Not deleting whole stack piece will make troubles with grinding object
if (stack.Count > 1)
{
_stack.SetCount(uid, stack.Count - 1);
_solutionContainerSystem.TryAddSolution(uid, solution, split);
return;
}
}
else if (component.UsesRemaining > 0)
{
return;
}