ActionBlocker CanSweat uses EntityUid exclusively
This commit is contained in:
@@ -279,7 +279,7 @@ namespace Content.Server.Body.Respiratory
|
|||||||
|
|
||||||
if (temperatureComponent.CurrentTemperature > NormalBodyTemperature)
|
if (temperatureComponent.CurrentTemperature > NormalBodyTemperature)
|
||||||
{
|
{
|
||||||
if (!actionBlocker.CanSweat(Owner)) return;
|
if (!actionBlocker.CanSweat(OwnerUid)) return;
|
||||||
if (!_isSweating)
|
if (!_isSweating)
|
||||||
{
|
{
|
||||||
Owner.PopupMessage(Loc.GetString("metabolism-component-is-sweating"));
|
Owner.PopupMessage(Loc.GetString("metabolism-component-is-sweating"));
|
||||||
|
|||||||
@@ -131,18 +131,12 @@ namespace Content.Shared.ActionBlocker
|
|||||||
return !ev.Cancelled;
|
return !ev.Cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanSweat(IEntity entity)
|
public bool CanSweat(EntityUid uid)
|
||||||
{
|
{
|
||||||
var ev = new SweatAttemptEvent(entity);
|
var ev = new SweatAttemptEvent(uid);
|
||||||
|
RaiseLocalEvent(uid, ev);
|
||||||
RaiseLocalEvent(entity.Uid, ev);
|
|
||||||
|
|
||||||
return !ev.Cancelled;
|
return !ev.Cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanSweat(EntityUid uid)
|
|
||||||
{
|
|
||||||
return CanSweat(EntityManager.GetEntity(uid));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ namespace Content.Shared.Body.Metabolism
|
|||||||
{
|
{
|
||||||
public class SweatAttemptEvent : CancellableEntityEventArgs
|
public class SweatAttemptEvent : CancellableEntityEventArgs
|
||||||
{
|
{
|
||||||
public SweatAttemptEvent(IEntity entity)
|
public SweatAttemptEvent(EntityUid uid)
|
||||||
{
|
{
|
||||||
Entity = entity;
|
Uid = uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEntity Entity { get; }
|
public EntityUid Uid { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user