ActionBlocker CanShiver uses EntityUid exclusively
This commit is contained in:
@@ -289,19 +289,19 @@ namespace Content.Server.Body.Respiratory
|
|||||||
// creadth: sweating does not help in airless environment
|
// creadth: sweating does not help in airless environment
|
||||||
if (EntitySystem.Get<AtmosphereSystem>().GetTileMixture(Owner.Transform.Coordinates) is not {})
|
if (EntitySystem.Get<AtmosphereSystem>().GetTileMixture(Owner.Transform.Coordinates) is not {})
|
||||||
{
|
{
|
||||||
temperatureSystem.RemoveHeat(Owner.Uid, Math.Min(targetHeat, SweatHeatRegulation), temperatureComponent);
|
temperatureSystem.RemoveHeat(OwnerUid, Math.Min(targetHeat, SweatHeatRegulation), temperatureComponent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!actionBlocker.CanShiver(Owner)) return;
|
if (!actionBlocker.CanShiver(OwnerUid)) return;
|
||||||
if (!_isShivering)
|
if (!_isShivering)
|
||||||
{
|
{
|
||||||
Owner.PopupMessage(Loc.GetString("metabolism-component-is-shivering"));
|
Owner.PopupMessage(Loc.GetString("metabolism-component-is-shivering"));
|
||||||
_isShivering = true;
|
_isShivering = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
temperatureSystem.ReceiveHeat(Owner.Uid, Math.Min(targetHeat, ShiveringHeatRegulation), temperatureComponent);
|
temperatureSystem.ReceiveHeat(OwnerUid, Math.Min(targetHeat, ShiveringHeatRegulation), temperatureComponent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -123,16 +123,12 @@ namespace Content.Shared.ActionBlocker
|
|||||||
return !ev.Cancelled;
|
return !ev.Cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanShiver(IEntity entity)
|
|
||||||
{
|
|
||||||
var ev = new ShiverAttemptEvent(entity);
|
|
||||||
|
|
||||||
return !ev.Cancelled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool CanShiver(EntityUid uid)
|
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)
|
public bool CanSweat(IEntity entity)
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ namespace Content.Shared.Body.Metabolism
|
|||||||
{
|
{
|
||||||
public class ShiverAttemptEvent : CancellableEntityEventArgs
|
public class ShiverAttemptEvent : CancellableEntityEventArgs
|
||||||
{
|
{
|
||||||
public ShiverAttemptEvent(IEntity entity)
|
public ShiverAttemptEvent(EntityUid uid)
|
||||||
{
|
{
|
||||||
Entity = entity;
|
Uid = uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEntity Entity { get; }
|
public EntityUid Uid { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user