Fix item slots spawning entities on startup instead of map init (#5501)
* spawn item slot entities on map init not startup * prevent locked state form destroying inheritance on save * fix whitelist for booze dispenser
This commit is contained in:
@@ -101,7 +101,7 @@ namespace Content.Shared.Containers.ItemSlots
|
|||||||
/// This doesn't have to mean the slot is somehow physically locked. In the case of the item cabinet, the
|
/// This doesn't have to mean the slot is somehow physically locked. In the case of the item cabinet, the
|
||||||
/// cabinet may simply be closed at the moment and needs to be opened first.
|
/// cabinet may simply be closed at the moment and needs to be opened first.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
[DataField("locked")]
|
[DataField("locked", readOnly: true)]
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
public bool Locked = false;
|
public bool Locked = false;
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ using Robust.Shared.IoC;
|
|||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Log;
|
using Robust.Shared.Log;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Utility;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
@@ -30,7 +29,7 @@ namespace Content.Shared.Containers.ItemSlots
|
|||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeLocalEvent<ItemSlotsComponent, ComponentStartup>(OnStartup);
|
SubscribeLocalEvent<ItemSlotsComponent, MapInitEvent>(OnMapInit);
|
||||||
SubscribeLocalEvent<ItemSlotsComponent, ComponentInit>(Oninitialize);
|
SubscribeLocalEvent<ItemSlotsComponent, ComponentInit>(Oninitialize);
|
||||||
|
|
||||||
SubscribeLocalEvent<ItemSlotsComponent, InteractUsingEvent>(OnInteractUsing);
|
SubscribeLocalEvent<ItemSlotsComponent, InteractUsingEvent>(OnInteractUsing);
|
||||||
@@ -50,7 +49,7 @@ namespace Content.Shared.Containers.ItemSlots
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Spawn in starting items for any item slots that should have one.
|
/// Spawn in starting items for any item slots that should have one.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void OnStartup(EntityUid uid, ItemSlotsComponent itemSlots, ComponentStartup args)
|
private void OnMapInit(EntityUid uid, ItemSlotsComponent itemSlots, MapInitEvent args)
|
||||||
{
|
{
|
||||||
foreach (var slot in itemSlots.Slots.Values)
|
foreach (var slot in itemSlots.Slots.Values)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -45,3 +45,9 @@
|
|||||||
- !type:PlaySoundBehavior
|
- !type:PlaySoundBehavior
|
||||||
sound:
|
sound:
|
||||||
path: /Audio/Effects/metalbreak.ogg
|
path: /Audio/Effects/metalbreak.ogg
|
||||||
|
- type: ReagentDispenser
|
||||||
|
beakerSlot:
|
||||||
|
whitelistFailPopup: reagent-dispenser-component-cannot-put-entity-message
|
||||||
|
whitelist:
|
||||||
|
components:
|
||||||
|
- FitsInDispenser
|
||||||
|
|||||||
@@ -9,11 +9,6 @@
|
|||||||
state: industrial-working
|
state: industrial-working
|
||||||
- type: ReagentDispenser
|
- type: ReagentDispenser
|
||||||
pack: ChemDispenserStandardInventory
|
pack: ChemDispenserStandardInventory
|
||||||
beakerSlot:
|
|
||||||
whitelistFailPopup: reagent-dispenser-component-cannot-put-entity-message
|
|
||||||
whitelist:
|
|
||||||
components:
|
|
||||||
- FitsInDispenser
|
|
||||||
- type: ApcPowerReceiver
|
- type: ApcPowerReceiver
|
||||||
- type: ExtensionCableReceiver
|
- type: ExtensionCableReceiver
|
||||||
- type: Construction
|
- type: Construction
|
||||||
|
|||||||
Reference in New Issue
Block a user