From 915631d51ca524cb99a20e633ee44b9f93a7306a Mon Sep 17 00:00:00 2001 From: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com> Date: Sat, 15 Aug 2020 07:07:09 -0700 Subject: [PATCH] Refactor collision to use hard instead of a workaround (#1677) --- .../Items/Storage/EntityStorageComponent.cs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs index 79bd216244..73d1fd09ca 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs @@ -10,7 +10,6 @@ using Content.Shared.GameObjects.EntitySystems; using Content.Shared.GameObjects.Verbs; using Content.Shared.Interfaces; using Content.Shared.Interfaces.GameObjects.Components; -using Content.Shared.Physics; using Robust.Server.GameObjects; using Robust.Server.GameObjects.Components.Container; using Robust.Server.GameObjects.EntitySystems; @@ -50,8 +49,6 @@ namespace Content.Server.GameObjects.Components.Items.Storage private bool _occludesLight; private bool _open; private bool _isWeldedShut; - private int _collisionMaskStorage; - private int _collisionLayerStorage; [ViewVariables] protected Container Contents; @@ -202,18 +199,13 @@ namespace Content.Server.GameObjects.Components.Items.Storage { if (!_isCollidableWhenOpen && Owner.TryGetComponent(out var collidableComponent)) { - var physShape = collidableComponent.PhysicsShapes[0]; if (Open) { - _collisionMaskStorage = physShape.CollisionMask; - physShape.CollisionMask = (int)CollisionGroup.Impassable; - _collisionLayerStorage = physShape.CollisionLayer; - physShape.CollisionLayer = (int)CollisionGroup.None; + collidableComponent.Hard = false; } else { - physShape.CollisionMask = _collisionMaskStorage; - physShape.CollisionLayer = _collisionLayerStorage; + collidableComponent.Hard = true; } }