Skip to content

Commit

Permalink
Spread stomach system updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Partmedia committed Dec 16, 2024
1 parent 1e9efb5 commit d0e8631
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Content.Server/Body/Systems/StomachSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
using Content.Shared.Chemistry.Components.SolutionManager;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using Robust.Shared.Random;

namespace Content.Server.Body.Systems
{
public sealed class StomachSystem : EntitySystem
{
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
[Dependency] private readonly IRobustRandom _random = default!;

public const string DefaultSolutionName = "stomach";

Expand All @@ -24,7 +26,7 @@ public override void Initialize()

private void OnMapInit(Entity<StomachComponent> ent, ref MapInitEvent args)
{
ent.Comp.NextUpdate = _gameTiming.CurTime + ent.Comp.UpdateInterval;
ent.Comp.NextUpdate = _gameTiming.CurTime + ent.Comp.UpdateInterval * (1+_random.NextFloat());
}

private void OnUnpaused(Entity<StomachComponent> ent, ref EntityUnpausedEvent args)
Expand Down

0 comments on commit d0e8631

Please sign in to comment.