@@ -2,7 +2,6 @@ using System.Linq;
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.Audio;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.Coordinates;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Emag.Components;
|
||||
using Content.Shared.Emag.Systems;
|
||||
@@ -10,7 +9,6 @@ using Content.Shared.Examine;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Content.Shared.Stacks;
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Map;
|
||||
@@ -102,7 +100,8 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
|
||||
|
||||
if (user != null)
|
||||
{
|
||||
_adminLog.Add(LogType.Action, LogImpact.High,
|
||||
_adminLog.Add(LogType.Action,
|
||||
LogImpact.High,
|
||||
$"{ToPrettyString(user.Value):player} destroyed {ToPrettyString(item)} in the material reclaimer, {ToPrettyString(uid)}");
|
||||
}
|
||||
|
||||
@@ -171,13 +170,19 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
|
||||
/// <summary>
|
||||
/// Sets the Enabled field on the reclaimer.
|
||||
/// </summary>
|
||||
public void SetReclaimerEnabled(EntityUid uid, bool enabled, MaterialReclaimerComponent? component = null)
|
||||
public bool SetReclaimerEnabled(EntityUid uid, bool enabled, MaterialReclaimerComponent? component = null)
|
||||
{
|
||||
if (!Resolve(uid, ref component, false))
|
||||
return;
|
||||
return true;
|
||||
|
||||
if (component.Broken && enabled)
|
||||
return false;
|
||||
|
||||
component.Enabled = enabled;
|
||||
AmbientSound.SetAmbience(uid, enabled && component.Powered);
|
||||
Dirty(uid, component);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -189,7 +194,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
|
||||
if (HasComp<ActiveMaterialReclaimerComponent>(uid))
|
||||
return false;
|
||||
|
||||
return component.Powered && component.Enabled;
|
||||
return component.Powered && component.Enabled && !component.Broken;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -200,6 +205,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
|
||||
{
|
||||
return component.Powered &&
|
||||
component.Enabled &&
|
||||
!component.Broken &&
|
||||
HasComp<BodyComponent>(victim) &&
|
||||
HasComp<EmaggedComponent>(uid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user