From bfc3203a21e53d848809879916c5fe9edcfd0f47 Mon Sep 17 00:00:00 2001 From: Rane <60792108+Elijahrane@users.noreply.github.com> Date: Tue, 3 May 2022 22:41:15 -0400 Subject: [PATCH] Drone blocker ignores dead ghost roles (#7782) --- Content.Server/Drone/DroneSystem.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Content.Server/Drone/DroneSystem.cs b/Content.Server/Drone/DroneSystem.cs index d2d026079a..b2c82716ca 100644 --- a/Content.Server/Drone/DroneSystem.cs +++ b/Content.Server/Drone/DroneSystem.cs @@ -4,6 +4,7 @@ using Content.Server.Drone.Components; using Content.Shared.Actions; using Content.Server.Light.Components; using Content.Shared.MobState; +using Content.Shared.MobState.Components; using Content.Shared.Interaction.Events; using Content.Shared.Interaction.Components; using Content.Shared.Examine; @@ -176,8 +177,12 @@ namespace Content.Server.Drone var xform = Comp(uid); foreach (var entity in _lookup.GetEntitiesInRange(xform.MapPosition, component.InteractionBlockRange)) { + // Return true if the entity is/was controlled by a player and is not a drone or ghost. if (HasComp(entity) && !HasComp(entity) && !HasComp(entity)) { + // Filter out dead ghost roles. Dead normal players are intended to block. + if ((TryComp(entity, out var entityMobState) && HasComp(entity) && entityMobState.IsDead())) + continue; if (_gameTiming.IsFirstTimePredicted) _popupSystem.PopupEntity(Loc.GetString("drone-too-close", ("being", entity)), uid, Filter.Entities(uid)); return true;