Fix Silo Distation (#1502)

<!--
This is a semi-strict format, you can add/remove sections as needed but
the order/format should be kept the same
Remove these comments before submitting
-->

# Description

<!--
Explain this PR in as much detail as applicable

Some example prompts to consider:
How might this affect the game? The codebase?
What might be some alternatives to this?
How/Who does this benefit/hurt [the game/codebase]?
-->

I forgot about it.

---

# Changelog

<!--
You can add an author after the `🆑` to change the name that appears
in the changelog (ex: `🆑 Death`)
Leaving it blank will default to your GitHub display name
This includes all available types for the changelog
-->

🆑 Aviu00
- fix: Fix silo being out of range.

(cherry picked from commit 34c2bbca74b5a10d6a8466e728cc48b0acda5655)
This commit is contained in:
Spatison
2025-01-12 12:22:30 +10:00
parent 72d9512a8b
commit 0d6fcb60f5

View File

@@ -4,6 +4,7 @@ using Content.Server.Station.Components;
using Content.Shared.DeviceLinking;
using Content.Shared.Lathe;
using Content.Shared.Materials;
using Robust.Server.GameStates;
using Robust.Shared.Timing;
namespace Content.Server.Materials;
@@ -11,6 +12,7 @@ namespace Content.Server.Materials;
public sealed class MaterialSiloSystem : SharedMaterialSiloSystem
{
[Dependency] private readonly LatheSystem _lathe = default!;
[Dependency] private readonly PvsOverrideSystem _pvs = default!;
public override void Initialize()
{
@@ -18,6 +20,8 @@ public sealed class MaterialSiloSystem : SharedMaterialSiloSystem
SubscribeLocalEvent<BecomesStationComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<MaterialSiloComponent, MaterialAmountChangedEvent>(OnMaterialAmountChanged);
SubscribeLocalEvent<MaterialSiloComponent, ComponentStartup>(OnStartup);
SubscribeLocalEvent<MaterialSiloComponent, ComponentShutdown>(OnShutdown);
}
private void OnMaterialAmountChanged(Entity<MaterialSiloComponent> ent, ref MaterialAmountChangedEvent args)
@@ -67,4 +71,14 @@ public sealed class MaterialSiloSystem : SharedMaterialSiloSystem
DeviceLink.LinkDefaults(null, silo.Value, utilizer, silo.Value.Comp, sink);
}
}
private void OnStartup(Entity<MaterialSiloComponent> ent, ref ComponentStartup args)
{
_pvs.AddGlobalOverride(ent);
}
private void OnShutdown(Entity<MaterialSiloComponent> ent, ref ComponentShutdown args)
{
_pvs.RemoveGlobalOverride(ent);
}
}