Fix thirst (#20472)

Co-authored-by: DrSmugleaf <drsmugleaf@gmail.com>
This commit is contained in:
Slava0135
2023-09-24 22:50:41 +03:00
committed by GitHub
parent 47c107c431
commit c4f3f5177a
4 changed files with 20 additions and 14 deletions

View File

@@ -1,6 +1,6 @@
using Content.Server.Nutrition.EntitySystems;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.Nutrition.Components;
using Content.Shared.Nutrition.EntitySystems;
using Robust.Shared.Prototypes;
namespace Content.Server.Chemistry.ReagentEffects
@@ -21,8 +21,9 @@ namespace Content.Server.Chemistry.ReagentEffects
/// Satiate thirst if a ThirstComponent can be found
public override void Effect(ReagentEffectArgs args)
{
if (args.EntityManager.TryGetComponent(args.SolutionEntity, out ThirstComponent? thirst))
EntitySystem.Get<ThirstSystem>().UpdateThirst(thirst, HydrationFactor);
var uid = args.SolutionEntity;
if (args.EntityManager.TryGetComponent(uid, out ThirstComponent? thirst))
EntitySystem.Get<ThirstSystem>().ModifyThirst(uid, thirst, HydrationFactor);
}
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)