diff --git a/Content.Server/VendingMachines/VendingMachineSystem.cs b/Content.Server/VendingMachines/VendingMachineSystem.cs index 60be1ad6f1b..ade01b10603 100644 --- a/Content.Server/VendingMachines/VendingMachineSystem.cs +++ b/Content.Server/VendingMachines/VendingMachineSystem.cs @@ -16,6 +16,7 @@ using Content.Shared.Emag.Systems; using Content.Shared.Emp; using Content.Shared.Popups; +using Content.Shared.Repairable; using Content.Shared.Throwing; using Content.Shared.UserInterface; using Content.Shared.VendingMachines; @@ -46,6 +47,7 @@ public override void Initialize() SubscribeLocalEvent(OnComponentMapInit); SubscribeLocalEvent(OnPowerChanged); SubscribeLocalEvent(OnBreak); + SubscribeLocalEvent(OnRepaired); // Floofstation SubscribeLocalEvent(OnEmagged); SubscribeLocalEvent(OnDamage); SubscribeLocalEvent(OnVendingPrice); @@ -88,7 +90,6 @@ private void OnVendingPrice(EntityUid uid, VendingMachineComponent component, re args.Price += price; } - protected override void OnComponentInit(EntityUid uid, VendingMachineComponent component, ComponentInit args) { base.OnComponentInit(uid, component, args); @@ -139,6 +140,17 @@ private void OnBreak(EntityUid uid, VendingMachineComponent vendComponent, Break TryUpdateVisualState(uid, vendComponent); } + // Floofstation + private void OnRepaired(EntityUid uid, VendingMachineComponent component, SharedRepairableSystem.RepairFinishedEvent args) + { + if (args.Cancelled) + return; + + // TODO it is not actually safe to assume that the repair repaired enough damage + component.Broken = false; + TryUpdateVisualState(uid, component); + } + private void OnEmagged(EntityUid uid, VendingMachineComponent component, ref GotEmaggedEvent args) { // only emag if there are emag-only items diff --git a/Content.Shared/Repairable/SharedRepairableSystem.cs b/Content.Shared/Repairable/SharedRepairableSystem.cs index 2b0cb670e6f..eb0d3fe0a1e 100644 --- a/Content.Shared/Repairable/SharedRepairableSystem.cs +++ b/Content.Shared/Repairable/SharedRepairableSystem.cs @@ -5,8 +5,9 @@ namespace Content.Shared.Repairable; public abstract partial class SharedRepairableSystem : EntitySystem { + // Floof - made public because WHY THE FUCK WAS THIS PRIVATE?! [Serializable, NetSerializable] - protected sealed partial class RepairFinishedEvent : SimpleDoAfterEvent + public sealed partial class RepairFinishedEvent : SimpleDoAfterEvent { } }