diff --git a/Content.Server/Storage/Components/EntityStorageComponent.cs b/Content.Server/Storage/Components/EntityStorageComponent.cs index 3bdd3cf325..4df618660b 100644 --- a/Content.Server/Storage/Components/EntityStorageComponent.cs +++ b/Content.Server/Storage/Components/EntityStorageComponent.cs @@ -2,6 +2,8 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Content.Server.Construction; +using Content.Server.Construction.Components; using Content.Server.Ghost.Components; using Content.Server.Tools; using Content.Shared.Acts; @@ -150,6 +152,9 @@ namespace Content.Server.Storage.Components Contents.ShowContents = _showContents; Contents.OccludesLight = _occludesLight; + if(_entMan.TryGetComponent(Owner, out ConstructionComponent? construction)) + EntitySystem.Get().AddContainer(Owner, Contents.ID, construction); + if (_entMan.TryGetComponent(Owner, out var surface)) { EntitySystem.Get().SetPlaceable(Owner, Open, surface); diff --git a/Resources/Changelog/Parts/crate.yml b/Resources/Changelog/Parts/crate.yml new file mode 100644 index 0000000000..1e32e45e9b --- /dev/null +++ b/Resources/Changelog/Parts/crate.yml @@ -0,0 +1,4 @@ +author: Zumorica +changes: + - type: Fix # One of the following: Add, Remove, Tweak, Fix + message: Crate deconstruction no longer deletes all of its contents. diff --git a/Resources/Prototypes/Recipes/Crafting/Graphs/storage/crategenericsteel.yml b/Resources/Prototypes/Recipes/Crafting/Graphs/storage/crategenericsteel.yml index d3b6f82446..689382908a 100644 --- a/Resources/Prototypes/Recipes/Crafting/Graphs/storage/crategenericsteel.yml +++ b/Resources/Prototypes/Recipes/Crafting/Graphs/storage/crategenericsteel.yml @@ -10,7 +10,7 @@ amount: 5 doAfter: 5 - + - node: crategenericsteel entity: CrateGenericSteel edges: @@ -25,4 +25,5 @@ - !type:SpawnPrototype prototype: SheetSteel1 amount: 5 - - !type:DeleteEntity {} \ No newline at end of file + - !type:EmptyAllContainers + - !type:DeleteEntity diff --git a/Resources/Prototypes/Recipes/Crafting/Graphs/storage/cratelivestock.yml b/Resources/Prototypes/Recipes/Crafting/Graphs/storage/cratelivestock.yml index c0e5ea999b..9ed0bb84db 100644 --- a/Resources/Prototypes/Recipes/Crafting/Graphs/storage/cratelivestock.yml +++ b/Resources/Prototypes/Recipes/Crafting/Graphs/storage/cratelivestock.yml @@ -10,7 +10,7 @@ amount: 5 doAfter: 5 - + - node: cratelivestock entity: CrateLivestock edges: @@ -22,4 +22,5 @@ - !type:SpawnPrototype prototype: MaterialWoodPlank1 amount: 5 - - !type:DeleteEntity {} \ No newline at end of file + - !type:EmptyAllContainers + - !type:DeleteEntity diff --git a/Resources/Prototypes/Recipes/Crafting/Graphs/storage/crateplastic.yml b/Resources/Prototypes/Recipes/Crafting/Graphs/storage/crateplastic.yml index ae5167afe1..e72821e32e 100644 --- a/Resources/Prototypes/Recipes/Crafting/Graphs/storage/crateplastic.yml +++ b/Resources/Prototypes/Recipes/Crafting/Graphs/storage/crateplastic.yml @@ -10,7 +10,7 @@ amount: 5 doAfter: 5 - + - node: crateplastic entity: CratePlastic edges: @@ -25,4 +25,5 @@ - !type:SpawnPrototype prototype: SheetPlastic1 amount: 5 - - !type:DeleteEntity {} \ No newline at end of file + - !type:EmptyAllContainers + - !type:DeleteEntity diff --git a/Resources/Prototypes/Recipes/Crafting/Graphs/storage/cratesecure.yml b/Resources/Prototypes/Recipes/Crafting/Graphs/storage/cratesecure.yml index bc4aa4bd43..0ac6888f17 100644 --- a/Resources/Prototypes/Recipes/Crafting/Graphs/storage/cratesecure.yml +++ b/Resources/Prototypes/Recipes/Crafting/Graphs/storage/cratesecure.yml @@ -1,5 +1,5 @@ - type: constructionGraph - id: CrateSecure + id: CrateSecure start: start graph: - node: start @@ -10,7 +10,7 @@ amount: 5 doAfter: 5 - + - node: cratesecure entity: CrateSecure edges: @@ -22,9 +22,10 @@ - !type:StorageWelded welded: false - !type:Locked - locked: false + locked: false completed: - !type:SpawnPrototype prototype: SheetSteel1 amount: 5 - - !type:DeleteEntity {} \ No newline at end of file + - !type:EmptyAllContainers + - !type:DeleteEntity