Skip to content

Commit

Permalink
fix KillPersonCondition (#2289)
Browse files Browse the repository at this point in the history
* aaaaaaaaaaaaaaaaaa

* what even was this
  • Loading branch information
MilonPL authored Nov 26, 2024
1 parent 0a6d09e commit d375f35
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Content.Server/Objectives/Systems/KillPersonConditionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PickRandomPersonComponent> 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<PickRandomHeadComponent> ent, ref ObjectiveAssignedEvent args)
{
AssignRandomTarget(uid, args, mind => HasComp<CommandStaffComponent>(uid));
AssignRandomTarget(ent, args, mindId =>
TryComp<MindComponent>(mindId, out var mind) &&
mind.OwnedEntity is { } ownedEnt &&
HasComp<CommandStaffComponent>(ownedEnt));
}

private void AssignRandomTarget(EntityUid uid, ObjectiveAssignedEvent args, Predicate<EntityUid> filter, bool fallbackToAny = true)
Expand Down

0 comments on commit d375f35

Please sign in to comment.