Skip to content

Commit

Permalink
fixed real
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyndomen committed Nov 14, 2024
1 parent 9b1f50b commit 2a4ecff
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
using Content.Shared.GameTicking;
using Content.Shared.Mind;
using Content.Shared.Objectives.Components;
using Robust.Shared.Random;

namespace Content.Server.Objectives.Systems;

/// <summary>
/// Handles kill person condition logic and picking random kill targets.
/// Handles teach a lesson condition logic, does not assign target.
/// </summary>
public sealed class TeachLessonConditionSystem : EntitySystem
{
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedMindSystem _mind = default!;
[Dependency] private readonly TargetObjectiveSystem _target = default!;

Expand All @@ -36,12 +34,15 @@ private void OnGetProgress(EntityUid uid, TeachLessonConditionComponent comp, re
private float GetProgress(EntityUid target)
{
// deleted or gibbed or something, counts as dead
if (!TryComp<MindComponent>(target, out var mind) || mind.OwnedEntity == null || _mind.IsCharacterDeadIc(mind) || !_wasKilled.Contains(target))
if (!TryComp<MindComponent>(target, out var mind) || mind.OwnedEntity == null || _mind.IsCharacterDeadIc(mind))
{
_wasKilled.Add(target);
return 1f;
}

if (_wasKilled.Contains(target))
{
return 1f;
}
return 0f;
}
// Clear the wasKilled list on round end
Expand Down

0 comments on commit 2a4ecff

Please sign in to comment.