mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* initial visual nubody * oops overlay * im so pheeming rn * conversion... * tests * comeback of the underwear * oops eyes * blabbl * zeds * yaml linted * search and visible count constraints * reordering * preserve previously selected markings colors * fix test * some ui niceties * ordering * make DB changes backwards-compatible/downgrade-friendly * fix things again * fix migration * vulpkanin markings limit increase * wrapping * code cleanup and more code cleanup and more code cleanup and more code cleanup and * fix slop ports * better sampling API * make filter work + use the method i made for its intended purpose * fix test fails real quick * magic mirror cleanup, remove TODO * don't 0-init the organ profile data * remove deltastates --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
34 lines
982 B
C#
34 lines
982 B
C#
using Content.Server.Objectives.Components;
|
|
using Content.Shared.Humanoid;
|
|
using Content.Shared.Objectives.Components;
|
|
|
|
namespace Content.Server.Objectives.Systems;
|
|
|
|
/// <summary>
|
|
/// Handles species requirement for objectives that require a certain species.
|
|
/// </summary>
|
|
public sealed class SpeciesRequirementSystem : EntitySystem
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<SpeciesRequirementComponent, RequirementCheckEvent>(OnCheck);
|
|
}
|
|
|
|
private void OnCheck(Entity<SpeciesRequirementComponent> requirement, ref RequirementCheckEvent args)
|
|
{
|
|
if (args.Cancelled)
|
|
return;
|
|
|
|
if (!TryComp<HumanoidProfileComponent>(args.Mind.OwnedEntity, out var appearance)) {
|
|
args.Cancelled = true;
|
|
return;
|
|
}
|
|
if (!requirement.Comp.AllowedSpecies.Contains(appearance.Species))
|
|
{
|
|
args.Cancelled = true;
|
|
return;
|
|
}
|
|
}
|
|
}
|