From 883cbf40b2ff76b14b216890fdd9bf6d39c05148 Mon Sep 17 00:00:00 2001 From: Vera Aguilera Puerto Date: Fri, 1 Oct 2021 13:47:38 +0200 Subject: [PATCH] Fix airlocks being opened by anything that bumps into them. - Adds DoorBumpOpener component. --- .../Doors/Components/DoorBumpOpenerComponent.cs | 10 ++++++++++ Content.Server/Doors/Systems/DoorSystem.cs | 5 +++++ Resources/Changelog/Parts/airlock.yml | 4 ++++ Resources/Prototypes/Entities/Mobs/Species/human.yml | 7 ++++--- Resources/Prototypes/Entities/Mobs/Species/slime.yml | 1 + Resources/Prototypes/Entities/Mobs/Species/vox.yml | 5 +++-- Resources/Prototypes/Entities/Objects/Devices/pda.yml | 1 + .../Entities/Objects/Misc/identification_cards.yml | 1 + 8 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 Content.Server/Doors/Components/DoorBumpOpenerComponent.cs create mode 100644 Resources/Changelog/Parts/airlock.yml diff --git a/Content.Server/Doors/Components/DoorBumpOpenerComponent.cs b/Content.Server/Doors/Components/DoorBumpOpenerComponent.cs new file mode 100644 index 0000000000..7cab56a756 --- /dev/null +++ b/Content.Server/Doors/Components/DoorBumpOpenerComponent.cs @@ -0,0 +1,10 @@ +using Robust.Shared.GameObjects; + +namespace Content.Server.Doors.Components +{ + [RegisterComponent] + public class DoorBumpOpenerComponent : Component + { + public override string Name => "DoorBumpOpener"; + } +} diff --git a/Content.Server/Doors/Systems/DoorSystem.cs b/Content.Server/Doors/Systems/DoorSystem.cs index 286caf371d..e24a838fa9 100644 --- a/Content.Server/Doors/Systems/DoorSystem.cs +++ b/Content.Server/Doors/Systems/DoorSystem.cs @@ -45,6 +45,11 @@ namespace Content.Server.Doors private void HandleCollide(EntityUid uid, ServerDoorComponent component, StartCollideEvent args) { + if (!args.OtherFixture.Body.Owner.HasComponent()) + { + return; + } + if (component.State != SharedDoorComponent.DoorState.Closed) { return; diff --git a/Resources/Changelog/Parts/airlock.yml b/Resources/Changelog/Parts/airlock.yml new file mode 100644 index 0000000000..8778948518 --- /dev/null +++ b/Resources/Changelog/Parts/airlock.yml @@ -0,0 +1,4 @@ +author: Zumorica +changes: + - type: Fix # One of the following: Add, Remove, Tweak, Fix + message: Fix airlocks being opened by bullets and any thrown items. They can still be opened by thrown IDs and PDAs though! diff --git a/Resources/Prototypes/Entities/Mobs/Species/human.yml b/Resources/Prototypes/Entities/Mobs/Species/human.yml index dc78b4ed6a..aaf9c6ee86 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/human.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/human.yml @@ -41,7 +41,7 @@ damage: types: Blunt: 5 - soundHit: + soundHit: path: /Audio/Effects/hit_kick.ogg - type: Hunger damage: @@ -209,10 +209,10 @@ CarbonDioxide: 0.00015190972 damage: types: - Asphyxiation: 1 + Asphyxiation: 1 damageRecovery: types: - Asphyxiation: -1 + Asphyxiation: -1 - type: Internals - type: MobState thresholds: @@ -273,6 +273,7 @@ attributes: proper: true - type: StandingState + - type: DoorBumpOpener - type: entity save: false diff --git a/Resources/Prototypes/Entities/Mobs/Species/slime.yml b/Resources/Prototypes/Entities/Mobs/Species/slime.yml index e80accdea6..e095a5ff61 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/slime.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/slime.yml @@ -93,3 +93,4 @@ - type: Body template: HumanoidTemplate preset: SlimePreset + - type: DoorBumpOpener diff --git a/Resources/Prototypes/Entities/Mobs/Species/vox.yml b/Resources/Prototypes/Entities/Mobs/Species/vox.yml index 2c4b27fe5e..d1c4f5db6c 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/vox.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/vox.yml @@ -92,10 +92,10 @@ CarbonDioxide: 0.00015190972 damage: types: - Asphyxiation: 1 + Asphyxiation: 1 damageRecovery: types: - Asphyxiation: -1 + Asphyxiation: -1 # - type: Appearance # visuals: # - type: RotationVisualizer @@ -114,3 +114,4 @@ categoriesFacialHair: VoxFacialHair - type: Inventory speciesId: vox + - type: DoorBumpOpener diff --git a/Resources/Prototypes/Entities/Objects/Devices/pda.yml b/Resources/Prototypes/Entities/Objects/Devices/pda.yml index c74b8ddbd9..2c613e2861 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/pda.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/pda.yml @@ -28,6 +28,7 @@ interfaces: - key: enum.PDAUiKey.Key type: PDABoundUserInterface + - type: DoorBumpOpener - type: entity parent: BasePDA diff --git a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml index e56c54817c..7bdae8dbf9 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml @@ -14,6 +14,7 @@ HeldPrefix: default - type: Access - type: IdCard + - type: DoorBumpOpener #IDs with layers