From 7a7d0017b504dec4b1d390b941af9791d9677287 Mon Sep 17 00:00:00 2001 From: 0x6273 <0x40@keemail.me> Date: Thu, 18 Jan 2024 02:30:30 +0100 Subject: [PATCH] Use old reagent dispenser beaker slot ID (#24209) Change the slot ID back to what it was to keep old map saves with an item in the slot loading correctly. This also fixes the "You can't put this in the dispenser!" message not appearing when inserting an item without FitsInDispenserComponent because the whitelisted slot name wasn't changed. --- Content.IntegrationTests/Tests/Chemistry/DispenserTest.cs | 2 +- .../Chemistry/Components/ReagentDispenserComponent.cs | 5 ----- .../Chemistry/EntitySystems/ReagentDispenserSystem.cs | 2 +- Content.Shared/Chemistry/SharedReagentDispenser.cs | 2 +- .../Structures/Dispensers/base_structuredispensers.yml | 2 +- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Content.IntegrationTests/Tests/Chemistry/DispenserTest.cs b/Content.IntegrationTests/Tests/Chemistry/DispenserTest.cs index 98bb7da6b7..a5449308be 100644 --- a/Content.IntegrationTests/Tests/Chemistry/DispenserTest.cs +++ b/Content.IntegrationTests/Tests/Chemistry/DispenserTest.cs @@ -25,7 +25,7 @@ public async Task InsertEjectBuiTest() await Interact(); // Eject beaker via BUI. - var ev = new ItemSlotButtonPressedEvent(ReagentDispenserComponent.BeakerSlotId); + var ev = new ItemSlotButtonPressedEvent(SharedReagentDispenser.OutputSlotName); await SendBui(ReagentDispenserUiKey.Key, ev); // Beaker is back in the player's hands diff --git a/Content.Server/Chemistry/Components/ReagentDispenserComponent.cs b/Content.Server/Chemistry/Components/ReagentDispenserComponent.cs index 4cf0d2e29e..eb1839ef2e 100644 --- a/Content.Server/Chemistry/Components/ReagentDispenserComponent.cs +++ b/Content.Server/Chemistry/Components/ReagentDispenserComponent.cs @@ -39,11 +39,6 @@ public sealed partial class ReagentDispenserComponent : Component [DataField] public EntityWhitelist? StorageWhitelist; - /// - /// Slot for container to dispense into. - /// - public static string BeakerSlotId = "ReagentDispenser-beakerSlot"; - [DataField] public ItemSlot BeakerSlot = new(); diff --git a/Content.Server/Chemistry/EntitySystems/ReagentDispenserSystem.cs b/Content.Server/Chemistry/EntitySystems/ReagentDispenserSystem.cs index 109d5f351a..d5ec310f87 100644 --- a/Content.Server/Chemistry/EntitySystems/ReagentDispenserSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/ReagentDispenserSystem.cs @@ -202,7 +202,7 @@ private void OnMapInit(EntityUid uid, ReagentDispenserComponent component, MapIn _itemSlotsSystem.AddItemSlot(uid, component.StorageSlotIds[i], component.StorageSlots[i]); } - _itemSlotsSystem.AddItemSlot(uid, ReagentDispenserComponent.BeakerSlotId, component.BeakerSlot); + _itemSlotsSystem.AddItemSlot(uid, SharedReagentDispenser.OutputSlotName, component.BeakerSlot); } } } diff --git a/Content.Shared/Chemistry/SharedReagentDispenser.cs b/Content.Shared/Chemistry/SharedReagentDispenser.cs index be71bf8a77..22cb87dcdb 100644 --- a/Content.Shared/Chemistry/SharedReagentDispenser.cs +++ b/Content.Shared/Chemistry/SharedReagentDispenser.cs @@ -8,7 +8,7 @@ namespace Content.Shared.Chemistry /// public sealed class SharedReagentDispenser { - public const string OutputSlotName = "ReagentDispenser-beakerSlot"; + public const string OutputSlotName = "beakerSlot"; } [Serializable, NetSerializable] diff --git a/Resources/Prototypes/Entities/Structures/Dispensers/base_structuredispensers.yml b/Resources/Prototypes/Entities/Structures/Dispensers/base_structuredispensers.yml index 4ce88c1582..c54e9f548b 100644 --- a/Resources/Prototypes/Entities/Structures/Dispensers/base_structuredispensers.yml +++ b/Resources/Prototypes/Entities/Structures/Dispensers/base_structuredispensers.yml @@ -68,7 +68,7 @@ containers: machine_board: !type:Container machine_parts: !type:Container - ReagentDispenser-beakerSlot: !type:ContainerSlot + beakerSlot: !type:ContainerSlot - type: StaticPrice price: 1000 - type: Wires