Pressure movements won't affect entities in containers. Use GetCardinalDirection.
This commit is contained in:
@@ -10,6 +10,7 @@ using Content.Shared.Atmos;
|
|||||||
using Content.Shared.Audio;
|
using Content.Shared.Audio;
|
||||||
using Content.Shared.Maps;
|
using Content.Shared.Maps;
|
||||||
using Robust.Server.GameObjects.EntitySystems;
|
using Robust.Server.GameObjects.EntitySystems;
|
||||||
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.GameObjects.Components;
|
using Robust.Shared.GameObjects.Components;
|
||||||
using Robust.Shared.GameObjects.Systems;
|
using Robust.Shared.GameObjects.Systems;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
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)))
|
foreach (var entity in _entityManager.GetEntitiesIntersecting(_mapManager.GetGrid(GridIndex).ParentMapId, Box2.UnitCentered.Translated(GridIndices)))
|
||||||
{
|
{
|
||||||
if (!entity.TryGetComponent(out ICollidableComponent physics)
|
if (!entity.TryGetComponent(out ICollidableComponent physics)
|
||||||
|| !entity.TryGetComponent(out MovedByPressureComponent pressure))
|
|| !entity.TryGetComponent(out MovedByPressureComponent pressure)
|
||||||
|
|| ContainerHelpers.IsInContainer(entity))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var pressureMovements = physics.EnsureController<HighPressureMovementController>();
|
var pressureMovements = physics.EnsureController<HighPressureMovementController>();
|
||||||
@@ -596,7 +598,7 @@ namespace Content.Server.Atmos
|
|||||||
if (difference > PressureDifference)
|
if (difference > PressureDifference)
|
||||||
{
|
{
|
||||||
PressureDifference = difference;
|
PressureDifference = difference;
|
||||||
_pressureDirection = ((Vector2i) (tile.GridIndices - GridIndices)).GetDir();
|
_pressureDirection = ((Vector2i) (tile.GridIndices - GridIndices)).GetCardinalDir();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user