Cleans up StatusIconSystem and fixing some bugs (#28270)

This commit is contained in:
AJCM-git
2024-06-03 12:12:21 -04:00
committed by GitHub
parent 87ffbab461
commit 8c10581010
49 changed files with 224 additions and 259 deletions

View File

@@ -90,14 +90,10 @@ namespace Content.Server.Access.Systems
private void OnJobIconChanged(EntityUid uid, AgentIDCardComponent comp, AgentIDCardJobIconChangedMessage args)
{
if (!TryComp<IdCardComponent>(uid, out var idCard))
{
return;
}
if (!_prototypeManager.TryIndex<StatusIconPrototype>(args.JobIconId, out var jobIcon))
{
if (!_prototypeManager.TryIndex(args.JobIconId, out var jobIcon))
return;
}
_cardSystem.TryChangeJobIcon(uid, jobIcon, idCard);
@@ -109,7 +105,7 @@ namespace Content.Server.Access.Systems
{
foreach (var jobPrototype in _prototypeManager.EnumeratePrototypes<JobPrototype>())
{
if(jobPrototype.Icon == jobIcon.ID)
if (jobPrototype.Icon == jobIcon.ID)
{
job = jobPrototype;
return true;