From aa7dc5f3fe44330c4871fe920b42eb9919a67c20 Mon Sep 17 00:00:00 2001 From: MehimoNemo <22804739+MehimoNemo@users.noreply.github.com> Date: Sun, 18 Apr 2021 03:03:31 -0500 Subject: [PATCH] Thrown Ids and PDAs unlock doors (#3856) * Removes code that checks if collision item is a person, allowing IDs and PDAs to open doors when thrown * Failed a test, so I torched that test. Combustible lemons. Test returned a fail if a random body could open an all access door, which is sorta what this whole thing does * Revert "Failed a test, so I torched that test. Combustible lemons." This reverts commit d2d8a6c49bab397cc8d5c1024d257ff51f3a4f7d. * Removed the one part that failed instead of trashing the whole thing --- .../Tests/Doors/AirlockTest.cs | 4 +--- .../Components/Doors/ServerDoorComponent.cs | 17 +---------------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/Content.IntegrationTests/Tests/Doors/AirlockTest.cs b/Content.IntegrationTests/Tests/Doors/AirlockTest.cs index 38176568f5..e367d8d1d4 100644 --- a/Content.IntegrationTests/Tests/Doors/AirlockTest.cs +++ b/Content.IntegrationTests/Tests/Doors/AirlockTest.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading.Tasks; using Content.Server.GameObjects.Components.Doors; using Content.Shared.GameObjects.Components.Doors; @@ -151,8 +151,6 @@ namespace Content.IntegrationTests.Tests.Doors // Keep the airlock awake so they collide airlock.GetComponent().WakeBody(); - // Ensure that it is still closed - Assert.That(doorComponent.State, Is.EqualTo(SharedDoorComponent.DoorState.Closed)); await server.WaitRunTicks(10); await server.WaitIdleAsync(); diff --git a/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs b/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs index ed4b7a63af..f17a5aa917 100644 --- a/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs +++ b/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs @@ -230,23 +230,8 @@ namespace Content.Server.GameObjects.Components.Doors // Disabled because it makes it suck hard to walk through double doors. - if (otherFixture.Body.Owner.HasComponent()) - { - if (!otherFixture.Body.Owner.TryGetComponent(out var mover)) return; - - /* - // TODO: temporary hack to fix the physics system raising collision events akwardly. - // E.g. when moving parallel to a door by going off the side of a wall. - var (walking, sprinting) = mover.VelocityDir; - // Also TODO: walking and sprint dir are added together here - // instead of calculating their contribution correctly. - var dotProduct = Vector2.Dot((sprinting + walking).Normalized, (entity.Transform.WorldPosition - Owner.Transform.WorldPosition).Normalized); - if (dotProduct <= -0.85f) - TryOpen(entity); - */ - TryOpen(otherFixture.Body.Owner); - } + } #region Opening