From cd7213243e7fd96c0860b19a2e06b4f381b2778d Mon Sep 17 00:00:00 2001 From: themias <89101928+themias@users.noreply.github.com> Date: Mon, 22 May 2023 17:58:04 -0400 Subject: [PATCH] Fix mime wall intersecting with adjacent wall (#16701) --- .../Abilities/Mime/MimePowersSystem.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Content.Server/Abilities/Mime/MimePowersSystem.cs b/Content.Server/Abilities/Mime/MimePowersSystem.cs index 0e67c44d36..cd5e2044c4 100644 --- a/Content.Server/Abilities/Mime/MimePowersSystem.cs +++ b/Content.Server/Abilities/Mime/MimePowersSystem.cs @@ -18,6 +18,7 @@ namespace Content.Server.Abilities.Mime [Dependency] private readonly SharedActionsSystem _actionsSystem = default!; [Dependency] private readonly AlertsSystem _alertsSystem = default!; [Dependency] private readonly EntityLookupSystem _lookupSystem = default!; + [Dependency] private readonly TurfSystem _turf = default!; [Dependency] private readonly IGameTiming _timing = default!; @@ -69,13 +70,17 @@ namespace Content.Server.Abilities.Mime if (tile == null) return; - // Check there are no walls or mobs there - foreach (var entity in _lookupSystem.GetEntitiesIntersecting(tile.Value, flags: LookupFlags.Static)) + // Check there are no walls there + if (_turf.IsTileBlocked(tile.Value, CollisionGroup.Impassable)) { - PhysicsComponent? physics = null; // We use this to check if it's impassable - if (HasComp(entity) && entity != uid // Is it a mob? - || Resolve(entity, ref physics, false) && (physics.CollisionLayer & (int) CollisionGroup.Impassable) != 0 // Is it impassable? - && !(TryComp(entity, out var door) && door.State != DoorState.Closed)) // Is it a door that's open and so not actually impassable? + _popupSystem.PopupEntity(Loc.GetString("mime-invisible-wall-failed"), uid, uid); + return; + } + + // Check there are no mobs there + foreach (var entity in _lookupSystem.GetEntitiesIntersecting(tile.Value)) + { + if (HasComp(entity) && entity != uid) { _popupSystem.PopupEntity(Loc.GetString("mime-invisible-wall-failed"), uid, uid); return;