Stasis bed cleanup and bugfixes. (#38762)

* Stasis bed sent to shed

* Code Review

* Code Review 2
This commit is contained in:
Nemanja
2025-07-05 20:59:31 -04:00
committed by GitHub
parent 7aaccb5b98
commit ab201b6e82
21 changed files with 243 additions and 222 deletions

View File

@@ -27,7 +27,7 @@ namespace Content.Shared.Body.Systems
private void OnMapInit(Entity<StomachComponent> ent, ref MapInitEvent args)
{
ent.Comp.NextUpdate = _gameTiming.CurTime + ent.Comp.UpdateInterval;
ent.Comp.NextUpdate = _gameTiming.CurTime + ent.Comp.AdjustedUpdateInterval;
}
private void OnUnpaused(Entity<StomachComponent> ent, ref EntityUnpausedEvent args)
@@ -53,7 +53,7 @@ namespace Content.Shared.Body.Systems
if (_gameTiming.CurTime < stomach.NextUpdate)
continue;
stomach.NextUpdate += stomach.UpdateInterval;
stomach.NextUpdate += stomach.AdjustedUpdateInterval;
// Get our solutions
if (!_solutionContainerSystem.ResolveSolution((uid, sol), DefaultSolutionName, ref stomach.Solution, out var stomachSolution))
@@ -67,7 +67,7 @@ namespace Content.Shared.Body.Systems
var queue = new RemQueue<StomachComponent.ReagentDelta>();
foreach (var delta in stomach.ReagentDeltas)
{
delta.Increment(stomach.UpdateInterval);
delta.Increment(stomach.AdjustedUpdateInterval);
if (delta.Lifetime > stomach.DigestionDelay)
{
if (stomachSolution.TryGetReagent(delta.ReagentQuantity.Reagent, out var reagent))
@@ -95,18 +95,9 @@ namespace Content.Shared.Body.Systems
}
}
private void OnApplyMetabolicMultiplier(
Entity<StomachComponent> ent,
ref ApplyMetabolicMultiplierEvent args)
private void OnApplyMetabolicMultiplier(Entity<StomachComponent> ent, ref ApplyMetabolicMultiplierEvent args)
{
if (args.Apply)
{
ent.Comp.UpdateInterval *= args.Multiplier;
return;
}
// This way we don't have to worry about it breaking if the stasis bed component is destroyed
ent.Comp.UpdateInterval /= args.Multiplier;
ent.Comp.UpdateIntervalMultiplier = args.Multiplier;
}
public bool CanTransferSolution(