From f0f1810155cc0c0cb4d46ca871e86d93de3f7675 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 3 Mar 2021 23:34:09 +0100 Subject: [PATCH] [MIRROR] Fix inability to demote certain subordinates with the ID card app. (#3818) * Fix inability to demote certain subordinates with the ID card app. (#57317) The trim system handles the interaction between heads and their air quotes "subordinates" differently. Instead of checking for head_subordinates - Which is a compiled list for who is and isn't a subordinate of who based on job datums - We instead check for the ability to apply a trim's access template to a card. This means that if you're able to assign a trim's access as a template, you're able to demote that trim too. This fixes some edge cases like being unable to demote Security Officer (Department) cards because technically Security Officer (Engineering) and Security Officer (Science) aren't real jobs (insert joke here) - They lack job datums and never get assigned as the HoS's subordinates. This is a much more modular and intuitive way of handling demotions. * Fix inability to demote certain subordinates with the ID card app. Co-authored-by: Timberpoes --- .../modular_computers/file_system/programs/card.dm | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/code/modules/modular_computers/file_system/programs/card.dm b/code/modules/modular_computers/file_system/programs/card.dm index 8aba016aa38..abb10e72078 100644 --- a/code/modules/modular_computers/file_system/programs/card.dm +++ b/code/modules/modular_computers/file_system/programs/card.dm @@ -18,8 +18,6 @@ var/authenticated_user /// The regions this program has access to based on the authenticated ID. var/list/region_access = list() - /// List of subordinate jobs for head roles on the authenticated ID. - var/list/head_subordinates = list() /// List of job templates that can be applied to ID cards from this program. var/list/job_templates = list() /// Which departments this program has access to. See region defines. @@ -60,14 +58,6 @@ head_types |= info["head"] job_templates |= info["templates"] - head_subordinates.Cut() - if(length(head_types)) - for(var/occupation in SSjob.occupations) - var/datum/job/job = occupation - for(var/head in head_types) - if(head in job.department_head) - head_subordinates += job.title - if(length(region_access)) minor = TRUE authenticated_user = "[id_card.name] \[LIMITED ACCESS\]" @@ -162,7 +152,7 @@ if(!computer || !authenticated_user) return TRUE if(minor) - if(!(target_id_card.trim?.assignment in head_subordinates) && target_id_card.trim?.assignment != "Assistant") + if(!(target_id_card.trim?.type in job_templates)) to_chat(usr, "Software error: You do not have the necessary permissions to demote this card.") return TRUE