ActionBlocker CanSweat uses EntityUid exclusively
This commit is contained in:
parent
cc9ae191a8
commit
29f3d2d1ca
|
|
@ -279,7 +279,7 @@ namespace Content.Server.Body.Respiratory
|
|||
|
||||
if (temperatureComponent.CurrentTemperature > NormalBodyTemperature)
|
||||
{
|
||||
if (!actionBlocker.CanSweat(Owner)) return;
|
||||
if (!actionBlocker.CanSweat(OwnerUid)) return;
|
||||
if (!_isSweating)
|
||||
{
|
||||
Owner.PopupMessage(Loc.GetString("metabolism-component-is-sweating"));
|
||||
|
|
|
|||
|
|
@ -131,18 +131,12 @@ namespace Content.Shared.ActionBlocker
|
|||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
public bool CanSweat(IEntity entity)
|
||||
public bool CanSweat(EntityUid uid)
|
||||
{
|
||||
var ev = new SweatAttemptEvent(entity);
|
||||
|
||||
RaiseLocalEvent(entity.Uid, ev);
|
||||
var ev = new SweatAttemptEvent(uid);
|
||||
RaiseLocalEvent(uid, ev);
|
||||
|
||||
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 SweatAttemptEvent(IEntity entity)
|
||||
public SweatAttemptEvent(EntityUid uid)
|
||||
{
|
||||
Entity = entity;
|
||||
Uid = uid;
|
||||
}
|
||||
|
||||
public IEntity Entity { get; }
|
||||
public EntityUid Uid { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue