Check smokable is in mouth (#9281)
This commit is contained in:
@@ -8,6 +8,7 @@ using Content.Server.Nutrition.Components;
|
|||||||
using Content.Shared.Chemistry;
|
using Content.Shared.Chemistry;
|
||||||
using Content.Shared.Chemistry.Reagent;
|
using Content.Shared.Chemistry.Reagent;
|
||||||
using Content.Shared.FixedPoint;
|
using Content.Shared.FixedPoint;
|
||||||
|
using Content.Shared.Inventory;
|
||||||
using Content.Shared.Smoking;
|
using Content.Shared.Smoking;
|
||||||
using Content.Shared.Temperature;
|
using Content.Shared.Temperature;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
@@ -20,6 +21,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
|||||||
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
|
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
|
||||||
[Dependency] private readonly BloodstreamSystem _bloodstreamSystem = default!;
|
[Dependency] private readonly BloodstreamSystem _bloodstreamSystem = default!;
|
||||||
[Dependency] private readonly AtmosphereSystem _atmos = default!;
|
[Dependency] private readonly AtmosphereSystem _atmos = default!;
|
||||||
|
[Dependency] private readonly InventorySystem _inventorySystem = default!;
|
||||||
|
|
||||||
private const float UpdateTimer = 3f;
|
private const float UpdateTimer = 3f;
|
||||||
|
|
||||||
@@ -110,8 +112,11 @@ namespace Content.Server.Nutrition.EntitySystems
|
|||||||
// This is awful. I hate this so much.
|
// This is awful. I hate this so much.
|
||||||
// TODO: Please, someone refactor containers and free me from this bullshit.
|
// TODO: Please, someone refactor containers and free me from this bullshit.
|
||||||
if (!smokable.Owner.TryGetContainerMan(out var containerManager) ||
|
if (!smokable.Owner.TryGetContainerMan(out var containerManager) ||
|
||||||
|
!(_inventorySystem.TryGetSlotEntity(containerManager.Owner, "mask", out var inMaskSlotUid) && inMaskSlotUid == smokable.Owner) ||
|
||||||
!TryComp(containerManager.Owner, out BloodstreamComponent? bloodstream))
|
!TryComp(containerManager.Owner, out BloodstreamComponent? bloodstream))
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
_reactiveSystem.ReactionEntity(containerManager.Owner, ReactionMethod.Ingestion, inhaledSolution);
|
_reactiveSystem.ReactionEntity(containerManager.Owner, ReactionMethod.Ingestion, inhaledSolution);
|
||||||
_bloodstreamSystem.TryAddToChemicals(containerManager.Owner, inhaledSolution, bloodstream);
|
_bloodstreamSystem.TryAddToChemicals(containerManager.Owner, inhaledSolution, bloodstream);
|
||||||
|
|||||||
Reference in New Issue
Block a user