diff --git a/Content.Server/Objectives/Systems/KillPersonConditionSystem.cs b/Content.Server/Objectives/Systems/KillPersonConditionSystem.cs index d61310908c3..80a3b405a84 100644 --- a/Content.Server/Objectives/Systems/KillPersonConditionSystem.cs +++ b/Content.Server/Objectives/Systems/KillPersonConditionSystem.cs @@ -38,14 +38,17 @@ private void OnGetProgress(EntityUid uid, KillPersonConditionComponent comp, ref args.Progress = GetProgress(target.Value, comp.RequireDead); } - private void OnPersonAssigned(EntityUid uid, PickRandomPersonComponent comp, ref ObjectiveAssignedEvent args) + private void OnPersonAssigned(Entity ent, ref ObjectiveAssignedEvent args) { - AssignRandomTarget(uid, args, _ => true); + AssignRandomTarget(ent, args, _ => true); } - private void OnHeadAssigned(EntityUid uid, PickRandomHeadComponent comp, ref ObjectiveAssignedEvent args) + private void OnHeadAssigned(Entity ent, ref ObjectiveAssignedEvent args) { - AssignRandomTarget(uid, args, mind => HasComp(uid)); + AssignRandomTarget(ent, args, mindId => + TryComp(mindId, out var mind) && + mind.OwnedEntity is { } ownedEnt && + HasComp(ownedEnt)); } private void AssignRandomTarget(EntityUid uid, ObjectiveAssignedEvent args, Predicate filter, bool fallbackToAny = true)