Skip to content

Commit cc9ae19

Browse files
committed
ActionBlocker CanShiver uses EntityUid exclusively
1 parent a2a8a63 commit cc9ae19

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

Content.Server/Body/Respiratory/RespiratorComponent.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -289,19 +289,19 @@ private void ProcessThermalRegulation(float frameTime)
289289
// creadth: sweating does not help in airless environment
290290
if (EntitySystem.Get<AtmosphereSystem>().GetTileMixture(Owner.Transform.Coordinates) is not {})
291291
{
292-
temperatureSystem.RemoveHeat(Owner.Uid, Math.Min(targetHeat, SweatHeatRegulation), temperatureComponent);
292+
temperatureSystem.RemoveHeat(OwnerUid, Math.Min(targetHeat, SweatHeatRegulation), temperatureComponent);
293293
}
294294
}
295295
else
296296
{
297-
if (!actionBlocker.CanShiver(Owner)) return;
297+
if (!actionBlocker.CanShiver(OwnerUid)) return;
298298
if (!_isShivering)
299299
{
300300
Owner.PopupMessage(Loc.GetString("metabolism-component-is-shivering"));
301301
_isShivering = true;
302302
}
303303

304-
temperatureSystem.ReceiveHeat(Owner.Uid, Math.Min(targetHeat, ShiveringHeatRegulation), temperatureComponent);
304+
temperatureSystem.ReceiveHeat(OwnerUid, Math.Min(targetHeat, ShiveringHeatRegulation), temperatureComponent);
305305
}
306306
}
307307

Content.Shared/ActionBlocker/ActionBlockerSystem.cs

+3-7
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,14 @@ public bool CanChangeDirection(EntityUid uid)
123123
return !ev.Cancelled;
124124
}
125125

126-
public bool CanShiver(IEntity entity)
126+
public bool CanShiver(EntityUid uid)
127127
{
128-
var ev = new ShiverAttemptEvent(entity);
128+
var ev = new ShiverAttemptEvent(uid);
129+
RaiseLocalEvent(uid, ev);
129130

130131
return !ev.Cancelled;
131132
}
132133

133-
public bool CanShiver(EntityUid uid)
134-
{
135-
return CanShiver(EntityManager.GetEntity(uid));
136-
}
137-
138134
public bool CanSweat(IEntity entity)
139135
{
140136
var ev = new SweatAttemptEvent(entity);

Content.Shared/Body/Metabolism/ShiverAttemptEvent.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ namespace Content.Shared.Body.Metabolism
44
{
55
public class ShiverAttemptEvent : CancellableEntityEventArgs
66
{
7-
public ShiverAttemptEvent(IEntity entity)
7+
public ShiverAttemptEvent(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)