diff --git a/Content.Client/ContextMenu/UI/ContextMenuView.cs b/Content.Client/ContextMenu/UI/ContextMenuView.cs index ed41f6314a..d3fe353091 100644 --- a/Content.Client/ContextMenu/UI/ContextMenuView.cs +++ b/Content.Client/ContextMenu/UI/ContextMenuView.cs @@ -77,7 +77,7 @@ namespace Content.Client.ContextMenu.UI AddToUI(orderedStates); _userInterfaceManager.ModalRoot.AddChild(rootContextMenu); - var size = rootContextMenu.List.CombinedMinimumSize; + var size = rootContextMenu.List.DesiredSize; var box = UIBox2.FromDimensions(_userInterfaceManager.MousePositionScaled.Position, size); rootContextMenu.Open(box); } @@ -92,7 +92,7 @@ namespace Content.Client.ContextMenu.UI AddToUI(orderedStates, stack); _userInterfaceManager.ModalRoot.AddChild(childContextMenu); - var size = childContextMenu.List.CombinedMinimumSize; + var size = childContextMenu.List.DesiredSize; childContextMenu.Open(UIBox2.FromDimensions(position + (stack.Width, 0), size)); } diff --git a/Content.Client/Suspicion/TraitorOverlay.cs b/Content.Client/Suspicion/TraitorOverlay.cs index d56601ab20..9646a42dfe 100644 --- a/Content.Client/Suspicion/TraitorOverlay.cs +++ b/Content.Client/Suspicion/TraitorOverlay.cs @@ -2,6 +2,7 @@ using Content.Shared.Examine; using Robust.Client.Graphics; using Robust.Client.Player; using Robust.Client.ResourceManagement; +using Robust.Shared.Containers; using Robust.Shared.Enums; using Robust.Shared.GameObjects; using Robust.Shared.IoC; @@ -64,11 +65,8 @@ namespace Content.Client.Suspicion continue; } - // all entities have a TransformComponent - var transform = physics.Owner.Transform; - // if not on the same map, continue - if (transform.MapID != _eyeManager.CurrentMap || !transform.IsMapTransform) + if (physics.Owner.Transform.MapID != _eyeManager.CurrentMap || physics.Owner.IsInContainer()) { continue; } diff --git a/Content.Client/Viewport/GameScreenBase.cs b/Content.Client/Viewport/GameScreenBase.cs index 92b704e839..6d90d9eadb 100644 --- a/Content.Client/Viewport/GameScreenBase.cs +++ b/Content.Client/Viewport/GameScreenBase.cs @@ -14,6 +14,7 @@ using Robust.Client.State; using Robust.Client.UserInterface; using Robust.Client.UserInterface.CustomControls; using Robust.Shared.Configuration; +using Robust.Shared.Containers; using Robust.Shared.GameObjects; using Robust.Shared.Input; using Robust.Shared.IoC; @@ -145,7 +146,7 @@ namespace Content.Client.Viewport foreach (var entity in entities) { if (entity.TryGetComponent(out var component) - && entity.Transform.IsMapTransform + && !entity.IsInContainer() && component.CheckClick(coordinates.Position, out var drawDepthClicked, out var renderOrder)) { foundEntities.Add((entity, drawDepthClicked, renderOrder)); diff --git a/Content.Server/Explosion/ExplosionHelper.cs b/Content.Server/Explosion/ExplosionHelper.cs index a2fbfe4244..5cf1d9f5f6 100644 --- a/Content.Server/Explosion/ExplosionHelper.cs +++ b/Content.Server/Explosion/ExplosionHelper.cs @@ -84,7 +84,7 @@ namespace Content.Server.Explosion // and splitted into two lists based on if they are Impassable or not foreach (var entity in entitiesInRange) { - if (entity.Deleted || !entity.Transform.IsMapTransform) + if (entity.Deleted || entity.IsInContainer()) { continue; } diff --git a/Content.Server/Storage/Components/ServerStorageComponent.cs b/Content.Server/Storage/Components/ServerStorageComponent.cs index a95546a55d..a92f85ed93 100644 --- a/Content.Server/Storage/Components/ServerStorageComponent.cs +++ b/Content.Server/Storage/Components/ServerStorageComponent.cs @@ -404,7 +404,7 @@ namespace Content.Server.Storage.Components var playerTransform = player.Transform; if (!playerTransform.Coordinates.InRange(Owner.EntityManager, ownerTransform.Coordinates, 2) || - !ownerTransform.IsMapTransform && !playerTransform.ContainsEntity(ownerTransform)) + Owner.IsInContainer() && !playerTransform.ContainsEntity(ownerTransform)) { break; } @@ -515,7 +515,7 @@ namespace Content.Server.Storage.Components var validStorables = new List(); foreach (var entity in IoCManager.Resolve().GetEntitiesInRange(eventArgs.ClickLocation, 1)) { - if (!entity.Transform.IsMapTransform + if (entity.IsInContainer() || entity == eventArgs.User || !entity.HasComponent()) continue; @@ -542,7 +542,7 @@ namespace Content.Server.Storage.Components foreach (var entity in validStorables) { // Check again, situation may have changed for some entities, but we'll still pick up any that are valid - if (!entity.Transform.IsMapTransform + if (entity.IsInContainer() || entity == eventArgs.User || !entity.HasComponent()) continue; @@ -571,7 +571,7 @@ namespace Content.Server.Storage.Components else if (_quickInsert) { if (eventArgs.Target == null - || !eventArgs.Target.Transform.IsMapTransform + || eventArgs.Target.IsInContainer() || eventArgs.Target == eventArgs.User || !eventArgs.Target.HasComponent()) return false; diff --git a/Content.Server/Weapon/Melee/MeleeWeaponSystem.cs b/Content.Server/Weapon/Melee/MeleeWeaponSystem.cs index a55c7a1581..a3fc0d2c06 100644 --- a/Content.Server/Weapon/Melee/MeleeWeaponSystem.cs +++ b/Content.Server/Weapon/Melee/MeleeWeaponSystem.cs @@ -12,6 +12,7 @@ using Content.Shared.Interaction; using Content.Shared.Physics; using Content.Shared.Weapons.Melee; using Robust.Shared.Audio; +using Robust.Shared.Containers; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; @@ -128,7 +129,7 @@ namespace Content.Server.Weapon.Melee var hitEntities = new List(); foreach (var entity in entities) { - if (!entity.Transform.IsMapTransform || entity == args.User) + if (entity.IsInContainer() || entity == args.User) continue; if (ComponentManager.HasComponent(entity.Uid))