From d375f353507cce5dac06e6c2d638748c7bae0146 Mon Sep 17 00:00:00 2001 From: Milon Date: Tue, 26 Nov 2024 09:26:47 +0100 Subject: [PATCH] fix KillPersonCondition (#2289) * aaaaaaaaaaaaaaaaaa * what even was this --- .../Objectives/Systems/KillPersonConditionSystem.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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)