Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepyyapril committed Dec 16, 2024
1 parent ed68f2d commit e01d6ba
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions Content.Shared/Roles/SharedRoleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,37 +242,6 @@ public bool IsAntagonistRole<T>()
public bool IsAntagonistRole(Type component)
{
return _antagTypes.Contains(component);
}

return CheckAntagonistStatus(mindId.Value).Item2;
}

private (bool, bool) CheckAntagonistStatus(EntityUid mindId)
{
if (!TryComp<MindComponent>(mindId, out var mind))
{
Log.Warning($"Antagonist status of mind entity {mindId} could not be determined - mind component not found");
return (false, false);
}

var antagonist = false;
var exclusiveAntag = false;
foreach (var role in mind.MindRoles)
{
if (!TryComp<MindRoleComponent>(role, out var roleComp))
{
//If this ever shows up outside of an integration test, then we need to look into this further.
Log.Warning($"Mind Role Entity {role} does not have MindRoleComponent!");
continue;
}

if (roleComp.Antag || exclusiveAntag)
antagonist = true;
if (roleComp.ExclusiveAntag)
exclusiveAntag = true;
}

return (antagonist, exclusiveAntag);
}

/// <summary>
Expand Down

0 comments on commit e01d6ba

Please sign in to comment.