Mind ECS (#16826)
This commit is contained in:
@@ -69,8 +69,8 @@ public sealed partial class ParticleAcceleratorSystem
|
||||
if (comp.Enabled || !comp.CanBeEnabled)
|
||||
return;
|
||||
|
||||
if (HasComp<MindComponent>(user?.AttachedEntity))
|
||||
_adminLogger.Add(LogType.Action, LogImpact.Low, $"{EntityManager.ToPrettyString((EntityUid) user!.AttachedEntity):player} has turned {EntityManager.ToPrettyString(uid)} on");
|
||||
if (user?.AttachedEntity is {} player)
|
||||
_adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(player):player} has turned {ToPrettyString(uid)} on");
|
||||
|
||||
comp.Enabled = true;
|
||||
UpdatePowerDraw(uid, comp);
|
||||
@@ -89,8 +89,8 @@ public sealed partial class ParticleAcceleratorSystem
|
||||
if (!comp.Enabled)
|
||||
return;
|
||||
|
||||
if (HasComp<MindComponent>(user?.AttachedEntity))
|
||||
_adminLogger.Add(LogType.Action, LogImpact.Low, $"{EntityManager.ToPrettyString((EntityUid) user!.AttachedEntity):player} has turned {EntityManager.ToPrettyString(uid)} off");
|
||||
if (user?.AttachedEntity is {} player)
|
||||
_adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(player):player} has turned {ToPrettyString(uid)} off");
|
||||
|
||||
comp.Enabled = false;
|
||||
UpdatePowerDraw(uid, comp);
|
||||
@@ -146,7 +146,7 @@ public sealed partial class ParticleAcceleratorSystem
|
||||
if (strength == comp.SelectedStrength)
|
||||
return;
|
||||
|
||||
if (HasComp<MindComponent>(user?.AttachedEntity))
|
||||
if (user?.AttachedEntity is {} player)
|
||||
{
|
||||
var impact = strength switch
|
||||
{
|
||||
@@ -158,7 +158,7 @@ public sealed partial class ParticleAcceleratorSystem
|
||||
or _ => LogImpact.Extreme,
|
||||
};
|
||||
|
||||
_adminLogger.Add(LogType.Action, impact, $"{EntityManager.ToPrettyString(user!.AttachedEntity!.Value):player} has set the strength of {EntityManager.ToPrettyString(uid)} to {strength}");
|
||||
_adminLogger.Add(LogType.Action, impact, $"{ToPrettyString(player):player} has set the strength of {ToPrettyString(uid)} to {strength}");
|
||||
}
|
||||
|
||||
comp.SelectedStrength = strength;
|
||||
|
||||
Reference in New Issue
Block a user