diff --git a/Content.Server/Body/Respiratory/RespiratorComponent.cs b/Content.Server/Body/Respiratory/RespiratorComponent.cs index 6fbb370b96..4ed3f26457 100644 --- a/Content.Server/Body/Respiratory/RespiratorComponent.cs +++ b/Content.Server/Body/Respiratory/RespiratorComponent.cs @@ -289,19 +289,19 @@ namespace Content.Server.Body.Respiratory // creadth: sweating does not help in airless environment if (EntitySystem.Get().GetTileMixture(Owner.Transform.Coordinates) is not {}) { - temperatureSystem.RemoveHeat(Owner.Uid, Math.Min(targetHeat, SweatHeatRegulation), temperatureComponent); + temperatureSystem.RemoveHeat(OwnerUid, Math.Min(targetHeat, SweatHeatRegulation), temperatureComponent); } } else { - if (!actionBlocker.CanShiver(Owner)) return; + if (!actionBlocker.CanShiver(OwnerUid)) return; if (!_isShivering) { Owner.PopupMessage(Loc.GetString("metabolism-component-is-shivering")); _isShivering = true; } - temperatureSystem.ReceiveHeat(Owner.Uid, Math.Min(targetHeat, ShiveringHeatRegulation), temperatureComponent); + temperatureSystem.ReceiveHeat(OwnerUid, Math.Min(targetHeat, ShiveringHeatRegulation), temperatureComponent); } } diff --git a/Content.Shared/ActionBlocker/ActionBlockerSystem.cs b/Content.Shared/ActionBlocker/ActionBlockerSystem.cs index 187142010f..7743a899a4 100644 --- a/Content.Shared/ActionBlocker/ActionBlockerSystem.cs +++ b/Content.Shared/ActionBlocker/ActionBlockerSystem.cs @@ -123,16 +123,12 @@ namespace Content.Shared.ActionBlocker return !ev.Cancelled; } - public bool CanShiver(IEntity entity) - { - var ev = new ShiverAttemptEvent(entity); - - return !ev.Cancelled; - } - public bool CanShiver(EntityUid uid) { - return CanShiver(EntityManager.GetEntity(uid)); + var ev = new ShiverAttemptEvent(uid); + RaiseLocalEvent(uid, ev); + + return !ev.Cancelled; } public bool CanSweat(IEntity entity) diff --git a/Content.Shared/Body/Metabolism/ShiverAttemptEvent.cs b/Content.Shared/Body/Metabolism/ShiverAttemptEvent.cs index d84630fa3c..b43a6a5729 100644 --- a/Content.Shared/Body/Metabolism/ShiverAttemptEvent.cs +++ b/Content.Shared/Body/Metabolism/ShiverAttemptEvent.cs @@ -4,11 +4,11 @@ namespace Content.Shared.Body.Metabolism { public class ShiverAttemptEvent : CancellableEntityEventArgs { - public ShiverAttemptEvent(IEntity entity) + public ShiverAttemptEvent(EntityUid uid) { - Entity = entity; + Uid = uid; } - public IEntity Entity { get; } + public EntityUid Uid { get; } } }