Fix crate deconstruction deleting all of its contents as well.
This commit is contained in:
@@ -2,6 +2,8 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Content.Server.Construction;
|
||||||
|
using Content.Server.Construction.Components;
|
||||||
using Content.Server.Ghost.Components;
|
using Content.Server.Ghost.Components;
|
||||||
using Content.Server.Tools;
|
using Content.Server.Tools;
|
||||||
using Content.Shared.Acts;
|
using Content.Shared.Acts;
|
||||||
@@ -150,6 +152,9 @@ namespace Content.Server.Storage.Components
|
|||||||
Contents.ShowContents = _showContents;
|
Contents.ShowContents = _showContents;
|
||||||
Contents.OccludesLight = _occludesLight;
|
Contents.OccludesLight = _occludesLight;
|
||||||
|
|
||||||
|
if(_entMan.TryGetComponent(Owner, out ConstructionComponent? construction))
|
||||||
|
EntitySystem.Get<ConstructionSystem>().AddContainer(Owner, Contents.ID, construction);
|
||||||
|
|
||||||
if (_entMan.TryGetComponent<PlaceableSurfaceComponent?>(Owner, out var surface))
|
if (_entMan.TryGetComponent<PlaceableSurfaceComponent?>(Owner, out var surface))
|
||||||
{
|
{
|
||||||
EntitySystem.Get<PlaceableSurfaceSystem>().SetPlaceable(Owner, Open, surface);
|
EntitySystem.Get<PlaceableSurfaceSystem>().SetPlaceable(Owner, Open, surface);
|
||||||
|
|||||||
4
Resources/Changelog/Parts/crate.yml
Normal file
4
Resources/Changelog/Parts/crate.yml
Normal file
@@ -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.
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
amount: 5
|
amount: 5
|
||||||
doAfter: 5
|
doAfter: 5
|
||||||
|
|
||||||
|
|
||||||
- node: crategenericsteel
|
- node: crategenericsteel
|
||||||
entity: CrateGenericSteel
|
entity: CrateGenericSteel
|
||||||
edges:
|
edges:
|
||||||
@@ -25,4 +25,5 @@
|
|||||||
- !type:SpawnPrototype
|
- !type:SpawnPrototype
|
||||||
prototype: SheetSteel1
|
prototype: SheetSteel1
|
||||||
amount: 5
|
amount: 5
|
||||||
- !type:DeleteEntity {}
|
- !type:EmptyAllContainers
|
||||||
|
- !type:DeleteEntity
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
amount: 5
|
amount: 5
|
||||||
doAfter: 5
|
doAfter: 5
|
||||||
|
|
||||||
|
|
||||||
- node: cratelivestock
|
- node: cratelivestock
|
||||||
entity: CrateLivestock
|
entity: CrateLivestock
|
||||||
edges:
|
edges:
|
||||||
@@ -22,4 +22,5 @@
|
|||||||
- !type:SpawnPrototype
|
- !type:SpawnPrototype
|
||||||
prototype: MaterialWoodPlank1
|
prototype: MaterialWoodPlank1
|
||||||
amount: 5
|
amount: 5
|
||||||
- !type:DeleteEntity {}
|
- !type:EmptyAllContainers
|
||||||
|
- !type:DeleteEntity
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
amount: 5
|
amount: 5
|
||||||
doAfter: 5
|
doAfter: 5
|
||||||
|
|
||||||
|
|
||||||
- node: crateplastic
|
- node: crateplastic
|
||||||
entity: CratePlastic
|
entity: CratePlastic
|
||||||
edges:
|
edges:
|
||||||
@@ -25,4 +25,5 @@
|
|||||||
- !type:SpawnPrototype
|
- !type:SpawnPrototype
|
||||||
prototype: SheetPlastic1
|
prototype: SheetPlastic1
|
||||||
amount: 5
|
amount: 5
|
||||||
- !type:DeleteEntity {}
|
- !type:EmptyAllContainers
|
||||||
|
- !type:DeleteEntity
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
- type: constructionGraph
|
- type: constructionGraph
|
||||||
id: CrateSecure
|
id: CrateSecure
|
||||||
start: start
|
start: start
|
||||||
graph:
|
graph:
|
||||||
- node: start
|
- node: start
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
amount: 5
|
amount: 5
|
||||||
doAfter: 5
|
doAfter: 5
|
||||||
|
|
||||||
|
|
||||||
- node: cratesecure
|
- node: cratesecure
|
||||||
entity: CrateSecure
|
entity: CrateSecure
|
||||||
edges:
|
edges:
|
||||||
@@ -22,9 +22,10 @@
|
|||||||
- !type:StorageWelded
|
- !type:StorageWelded
|
||||||
welded: false
|
welded: false
|
||||||
- !type:Locked
|
- !type:Locked
|
||||||
locked: false
|
locked: false
|
||||||
completed:
|
completed:
|
||||||
- !type:SpawnPrototype
|
- !type:SpawnPrototype
|
||||||
prototype: SheetSteel1
|
prototype: SheetSteel1
|
||||||
amount: 5
|
amount: 5
|
||||||
- !type:DeleteEntity {}
|
- !type:EmptyAllContainers
|
||||||
|
- !type:DeleteEntity
|
||||||
|
|||||||
Reference in New Issue
Block a user