From fd40c5157bdb5165fba547add32f923670d48526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Aguilera=20Puerto?= Date: Sat, 15 Aug 2020 03:20:25 +0200 Subject: [PATCH] Pressure movements won't affect entities in containers. Use GetCardinalDirection. --- Content.Server/Atmos/TileAtmosphere.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Content.Server/Atmos/TileAtmosphere.cs b/Content.Server/Atmos/TileAtmosphere.cs index 6888dce918..851091f7bd 100644 --- a/Content.Server/Atmos/TileAtmosphere.cs +++ b/Content.Server/Atmos/TileAtmosphere.cs @@ -10,6 +10,7 @@ using Content.Shared.Atmos; using Content.Shared.Audio; using Content.Shared.Maps; using Robust.Server.GameObjects.EntitySystems; +using Robust.Shared.Containers; using Robust.Shared.GameObjects.Components; using Robust.Shared.GameObjects.Systems; using Robust.Shared.Interfaces.GameObjects; @@ -176,7 +177,8 @@ namespace Content.Server.Atmos foreach (var entity in _entityManager.GetEntitiesIntersecting(_mapManager.GetGrid(GridIndex).ParentMapId, Box2.UnitCentered.Translated(GridIndices))) { if (!entity.TryGetComponent(out ICollidableComponent physics) - || !entity.TryGetComponent(out MovedByPressureComponent pressure)) + || !entity.TryGetComponent(out MovedByPressureComponent pressure) + || ContainerHelpers.IsInContainer(entity)) continue; var pressureMovements = physics.EnsureController(); @@ -596,7 +598,7 @@ namespace Content.Server.Atmos if (difference > PressureDifference) { PressureDifference = difference; - _pressureDirection = ((Vector2i) (tile.GridIndices - GridIndices)).GetDir(); + _pressureDirection = ((Vector2i) (tile.GridIndices - GridIndices)).GetCardinalDir(); } }