Skip to content

Commit 29f3d2d

Browse files
committed
ActionBlocker CanSweat uses EntityUid exclusively
1 parent cc9ae19 commit 29f3d2d

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

Content.Server/Body/Respiratory/RespiratorComponent.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ private void ProcessThermalRegulation(float frameTime)
279279

280280
if (temperatureComponent.CurrentTemperature > NormalBodyTemperature)
281281
{
282-
if (!actionBlocker.CanSweat(Owner)) return;
282+
if (!actionBlocker.CanSweat(OwnerUid)) return;
283283
if (!_isSweating)
284284
{
285285
Owner.PopupMessage(Loc.GetString("metabolism-component-is-sweating"));

Content.Shared/ActionBlocker/ActionBlockerSystem.cs

+3-9
Original file line numberDiff line numberDiff line change
@@ -131,18 +131,12 @@ public bool CanShiver(EntityUid uid)
131131
return !ev.Cancelled;
132132
}
133133

134-
public bool CanSweat(IEntity entity)
134+
public bool CanSweat(EntityUid uid)
135135
{
136-
var ev = new SweatAttemptEvent(entity);
137-
138-
RaiseLocalEvent(entity.Uid, ev);
136+
var ev = new SweatAttemptEvent(uid);
137+
RaiseLocalEvent(uid, ev);
139138

140139
return !ev.Cancelled;
141140
}
142-
143-
public bool CanSweat(EntityUid uid)
144-
{
145-
return CanSweat(EntityManager.GetEntity(uid));
146-
}
147141
}
148142
}

Content.Shared/Body/Metabolism/SweatAttemptEvent.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ namespace Content.Shared.Body.Metabolism
44
{
55
public class SweatAttemptEvent : CancellableEntityEventArgs
66
{
7-
public SweatAttemptEvent(IEntity entity)
7+
public SweatAttemptEvent(EntityUid uid)
88
{
9-
Entity = entity;
9+
Uid = uid;
1010
}
1111

12-
public IEntity Entity { get; }
12+
public EntityUid Uid { get; }
1313
}
1414
}

0 commit comments

Comments
 (0)