From: qwerltaz <69696513+qwerltaz@users.noreply.github.com> Date: Wed, 6 Dec 2023 03:03:31 +0000 (+0100) Subject: Fix wallmount board dropping at random side of the wall (#21920) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=daa70fc92c139ae841d6056284591fad52e2a9cf;p=space-station-14.git Fix wallmount board dropping at random side of the wall (#21920) * empty wallmount board at user * change to DropNextTo * add emptyAtUser to doors --- diff --git a/Content.Server/Construction/Completions/EmptyAllContainers.cs b/Content.Server/Construction/Completions/EmptyAllContainers.cs index 5b086efb4a..79de939387 100644 --- a/Content.Server/Construction/Completions/EmptyAllContainers.cs +++ b/Content.Server/Construction/Completions/EmptyAllContainers.cs @@ -3,7 +3,10 @@ using Content.Shared.Construction; using Content.Shared.Hands.Components; using JetBrains.Annotations; using Robust.Server.Containers; +using Robust.Server.GameObjects; using Robust.Shared.Containers; +using Robust.Shared.GameObjects; +using Robust.Shared.Map; namespace Content.Server.Construction.Completions { @@ -14,9 +17,15 @@ namespace Content.Server.Construction.Completions /// /// Whether or not the user should attempt to pick up the removed entities. /// - [DataField("pickup")] + [DataField] public bool Pickup = false; + /// + /// Whether or not to empty the container at the user's location. + /// + [DataField] + public bool EmptyAtUser = false; + public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager) { if (!entityManager.TryGetComponent(uid, out ContainerManagerComponent? containerManager)) @@ -24,6 +33,7 @@ namespace Content.Server.Construction.Completions var containerSys = entityManager.EntitySysManager.GetEntitySystem(); var handSys = entityManager.EntitySysManager.GetEntitySystem(); + var transformSys = entityManager.EntitySysManager.GetEntitySystem(); HandsComponent? hands = null; var pickup = Pickup && entityManager.TryGetComponent(userUid, out hands); @@ -32,6 +42,9 @@ namespace Content.Server.Construction.Completions { foreach (var ent in containerSys.EmptyContainer(container, true, reparent: !pickup)) { + if (EmptyAtUser && userUid is not null) + transformSys.DropNextTo(ent, (EntityUid) userUid); + if (pickup) handSys.PickupOrDrop(userUid, ent, handsComp: hands); } diff --git a/Resources/Prototypes/Entities/Structures/Doors/SecretDoor/secret_door.yml b/Resources/Prototypes/Entities/Structures/Doors/SecretDoor/secret_door.yml index 9605b7edec..cafaea3a22 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/SecretDoor/secret_door.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/SecretDoor/secret_door.yml @@ -54,6 +54,12 @@ key: walls mode: NoSprite - type: Occluder + - type: ContainerFill + containers: + battery-container: [ PowerCellMedium ] + - type: ContainerContainer + containers: + battery-container: !type:Container - type: entity id: BaseSecretDoorAssembly diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml index 4ddeb38519..3cd22bbfc7 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml @@ -81,7 +81,9 @@ conditions: - !type:EntityAnchored {} completed: - - !type:EmptyAllContainers {} + - !type:EmptyAllContainers + pickup: true + emptyAtUser: true steps: - tool: Prying doAfter: 5 @@ -102,7 +104,9 @@ conditions: - !type:EntityAnchored {} completed: - - !type:EmptyAllContainers {} + - !type:EmptyAllContainers + pickup: true + emptyAtUser: true - !type:SpawnPrototype prototype: SheetRGlass1 amount: 1 @@ -134,7 +138,7 @@ steps: - tool: Prying doAfter: 2 - + - to: medSecurityUnfinished conditions: - !type:WirePanel {} @@ -142,7 +146,7 @@ - material: Steel amount: 2 doAfter: 2 - + - to: highSecurityUnfinished conditions: - !type:WirePanel {} @@ -150,7 +154,7 @@ - material: Plasteel amount: 2 doAfter: 2 - + ## Standard airlock - node: airlock entity: Airlock @@ -169,11 +173,13 @@ - !type:WirePanel {} - !type:AllWiresCut completed: - - !type:EmptyAllContainers {} + - !type:EmptyAllContainers + pickup: true + emptyAtUser: true steps: - tool: Prying doAfter: 5 - + - to: medSecurityUnfinished conditions: - !type:WirePanel {} @@ -181,7 +187,7 @@ - material: Steel amount: 2 doAfter: 2 - + - to: highSecurityUnfinished conditions: - !type:WirePanel {} @@ -196,7 +202,7 @@ - !type:SetWiresPanelSecurity wiresAccessible: true weldingAllowed: true - edges: + edges: - to: medSecurityUnfinished conditions: - !type:WirePanel {} @@ -204,7 +210,7 @@ - material: Steel amount: 2 doAfter: 2 - + - to: highSecurityUnfinished conditions: - !type:WirePanel {} @@ -221,7 +227,7 @@ wiresAccessible: false weldingAllowed: false edges: - - to: glassAirlock + - to: glassAirlock completed: - !type:GivePrototype prototype: SheetSteel1 @@ -233,8 +239,8 @@ steps: - tool: Prying doAfter: 4 - - - to: airlock + + - to: airlock completed: - !type:GivePrototype prototype: SheetSteel1 @@ -246,8 +252,8 @@ steps: - tool: Prying doAfter: 4 - - - to: highSecDoor + + - to: highSecDoor completed: - !type:GivePrototype prototype: SheetSteel1 @@ -259,14 +265,14 @@ steps: - tool: Prying doAfter: 4 - - - to: medSecurity - conditions: + + - to: medSecurity + conditions: - !type:WirePanel {} steps: - tool: Welding doAfter: 3 - + - node: medSecurity actions: - !type:SetWiresPanelSecurity @@ -274,7 +280,7 @@ wiresAccessible: false weldingAllowed: false edges: - - to: medSecurityUnfinished + - to: medSecurityUnfinished conditions: - !type:WirePanel {} steps: @@ -289,7 +295,7 @@ wiresAccessible: false weldingAllowed: false edges: - - to: glassAirlock + - to: glassAirlock completed: - !type:GivePrototype prototype: SheetPlasteel1 @@ -301,8 +307,8 @@ steps: - tool: Prying doAfter: 4 - - - to: airlock + + - to: airlock completed: - !type:GivePrototype prototype: SheetPlasteel1 @@ -314,8 +320,8 @@ steps: - tool: Prying doAfter: 4 - - - to: highSecDoor + + - to: highSecDoor completed: - !type:GivePrototype prototype: SheetPlasteel1 @@ -327,14 +333,14 @@ steps: - tool: Prying doAfter: 4 - - - to: highSecurity - conditions: + + - to: highSecurity + conditions: - !type:WirePanel {} steps: - tool: Welding doAfter: 5 - + - node: highSecurity actions: - !type:SetWiresPanelSecurity @@ -348,16 +354,16 @@ steps: - tool: Welding doAfter: 15 - + - to: maxSecurity conditions: - !type:WirePanel {} - steps: + steps: - material: MetalRod amount: 2 doAfter: 1 -## Max security level door: an electric grill is added +## Max security level door: an electric grill is added - node: maxSecurity actions: - !type:SetWiresPanelSecurity @@ -365,27 +371,27 @@ wiresAccessible: false weldingAllowed: true edges: - - to: highSecurity + - to: highSecurity completed: - !type:AttemptElectrocute - !type:GivePrototype prototype: PartRodMetal1 amount: 2 - conditions: + conditions: - !type:WirePanel {} steps: - tool: Cutting - doAfter: 0.5 + doAfter: 0.5 - to: superMaxSecurityUnfinished conditions: - !type:WirePanel {} - steps: + steps: - material: Plasteel amount: 2 doAfter: 2 -## Super max security level door: an additional layer of plasteel is added +## Super max security level door: an additional layer of plasteel is added - node: superMaxSecurityUnfinished actions: - !type:SetWiresPanelSecurity @@ -393,7 +399,7 @@ wiresAccessible: false weldingAllowed: false edges: - - to: maxSecurity + - to: maxSecurity completed: - !type:GivePrototype prototype: SheetPlasteel1 @@ -403,25 +409,25 @@ steps: - tool: Prying doAfter: 4 - - - to: superMaxSecurity - conditions: + + - to: superMaxSecurity + conditions: - !type:WirePanel {} steps: - tool: Welding doAfter: 5 - + - node: superMaxSecurity actions: - !type:SetWiresPanelSecurity examine: wires-panel-component-on-examine-security-level7 - wiresAccessible: false + wiresAccessible: false weldingAllowed: false edges: - - to: superMaxSecurityUnfinished + - to: superMaxSecurityUnfinished conditions: - !type:WirePanel {} steps: - tool: Welding - doAfter: 15 - + doAfter: 15 + diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/structures/firelock.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/firelock.yml index 9d5b2945a6..0dbf26794d 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/structures/firelock.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/structures/firelock.yml @@ -80,7 +80,9 @@ doAfter: 0.25 - to: frame2 completed: - - !type:EmptyAllContainers {} + - !type:EmptyAllContainers + pickup: true + emptyAtUser: true conditions: - !type:EntityAnchored anchored: true diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/structures/secretdoor.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/secretdoor.yml index 8acaa5f505..336933a36b 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/structures/secretdoor.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/structures/secretdoor.yml @@ -80,7 +80,9 @@ - !type:EntityAnchored {} - !type:DoorWelded {} completed: - - !type:EmptyAllContainers {} + - !type:EmptyAllContainers + pickup: true + emptyAtUser: true steps: - tool: Prying doAfter: 5 diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/structures/shuttle.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/shuttle.yml index dc05edd8fb..457fbfede5 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/structures/shuttle.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/structures/shuttle.yml @@ -54,7 +54,9 @@ doAfter: 2.5 - to: assembly completed: - - !type:EmptyAllContainers {} + - !type:EmptyAllContainers + pickup: true + emptyAtUser: true steps: - tool: Prying doAfter: 1 diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/structures/windoor.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/windoor.yml index a991884acb..9e19196c6c 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/structures/windoor.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/structures/windoor.yml @@ -113,7 +113,9 @@ - !type:WirePanel {} - !type:AllWiresCut completed: - - !type:EmptyAllContainers {} + - !type:EmptyAllContainers + pickup: true + emptyAtUser: true steps: - tool: Anchoring doAfter: 1 @@ -213,7 +215,9 @@ container: board - !type:AllWiresCut completed: - - !type:EmptyAllContainers {} + - !type:EmptyAllContainers + pickup: true + emptyAtUser: true steps: - tool: Anchoring doAfter: 4 diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/air_alarms.yml b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/air_alarms.yml index ca5cb5f108..5aee750b9a 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/air_alarms.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/air_alarms.yml @@ -70,7 +70,9 @@ - !type:ContainerNotEmpty container: board completed: - - !type:EmptyAllContainers {} + - !type:EmptyAllContainers + pickup: true + emptyAtUser: true steps: - tool: Prying doAfter: 1 @@ -147,7 +149,9 @@ - !type:ContainerNotEmpty container: board completed: - - !type:EmptyAllContainers {} + - !type:EmptyAllContainers + pickup: true + emptyAtUser: true steps: - tool: Prying doAfter: 1 diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/intercom.yml b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/intercom.yml index 8da7a2a032..2247860f89 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/intercom.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/intercom.yml @@ -66,7 +66,9 @@ - !type:ContainerNotEmpty container: board completed: - - !type:EmptyAllContainers {} + - !type:EmptyAllContainers + pickup: true + emptyAtUser: true steps: - tool: Prying doAfter: 1 diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/station_maps.yml b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/station_maps.yml index 43a111ec7f..eb826a0f98 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/station_maps.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/station_maps.yml @@ -70,7 +70,9 @@ - !type:ContainerNotEmpty container: board completed: - - !type:EmptyAllContainers {} + - !type:EmptyAllContainers + pickup: true + emptyAtUser: true steps: - tool: Prying doAfter: 1 diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/timer.yml b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/timer.yml index 6c5def7c4c..0d400a848d 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/timer.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/timer.yml @@ -84,7 +84,9 @@ - !type:ContainerNotEmpty container: board completed: - - !type:EmptyAllContainers {} + - !type:EmptyAllContainers + pickup: true + emptyAtUser: true - node: screenElectronics edges: @@ -101,7 +103,9 @@ - !type:ContainerNotEmpty container: board completed: - - !type:EmptyAllContainers {} + - !type:EmptyAllContainers + pickup: true + emptyAtUser: true - node: brigElectronics edges: @@ -118,7 +122,9 @@ - !type:ContainerNotEmpty container: board completed: - - !type:EmptyAllContainers {} + - !type:EmptyAllContainers + pickup: true + emptyAtUser: true - node: screenGlass entity: TimerFrame diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/wallmount_generator.yml b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/wallmount_generator.yml index 3df8d9c818..24d928cc40 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/wallmount_generator.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/wallmount_generator.yml @@ -84,7 +84,9 @@ - !type:ContainerNotEmpty container: board completed: - - !type:EmptyAllContainers {} + - !type:EmptyAllContainers + pickup: true + emptyAtUser: true steps: - tool: Prying doAfter: 1 @@ -98,7 +100,9 @@ - !type:ContainerNotEmpty container: board completed: - - !type:EmptyAllContainers {} + - !type:EmptyAllContainers + pickup: true + emptyAtUser: true steps: - tool: Prying doAfter: 1 diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/wallmount_substation.yml b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/wallmount_substation.yml index 78a1a34c6a..381871f94a 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/wallmount_substation.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/wallmount_substation.yml @@ -68,7 +68,9 @@ - !type:ContainerNotEmpty container: board completed: - - !type:EmptyAllContainers {} + - !type:EmptyAllContainers + pickup: true + emptyAtUser: true steps: - tool: Prying doAfter: 1