mirror of
https://github.com/CHOMPstation/CHOMPstation.git
synced 2026-08-23 20:16:19 +01:00
Merge pull request #4754 from VOREStation/vplk-id-refactor
Fix IDs so they do not instantiate every job datum on New
This commit is contained in:
@@ -112,15 +112,11 @@
|
||||
usr << "The fingerprint hash on the card is [fingerprint_hash]."
|
||||
return
|
||||
|
||||
/obj/item/weapon/card/id/New()
|
||||
..()
|
||||
var/datum/job/jobdatum
|
||||
for(var/jobtype in typesof(/datum/job))
|
||||
var/datum/job/J = new jobtype
|
||||
if(J.title == rank)
|
||||
jobdatum = J
|
||||
access = jobdatum.get_access()
|
||||
return
|
||||
/obj/item/weapon/card/id/initialize()
|
||||
. = ..()
|
||||
var/datum/job/J = job_master.GetJob(rank)
|
||||
if(J)
|
||||
access = J.get_access()
|
||||
|
||||
/obj/item/weapon/card/id/silver
|
||||
name = "identification card"
|
||||
@@ -163,8 +159,8 @@
|
||||
item_state = "tdgreen"
|
||||
assignment = "Synthetic"
|
||||
|
||||
/obj/item/weapon/card/id/synthetic/New()
|
||||
..()
|
||||
/obj/item/weapon/card/id/synthetic/initialize()
|
||||
. = ..()
|
||||
access = get_all_station_access() + access_synth
|
||||
|
||||
/obj/item/weapon/card/id/centcom
|
||||
@@ -174,12 +170,12 @@
|
||||
registered_name = "Central Command"
|
||||
assignment = "General"
|
||||
|
||||
/obj/item/weapon/card/id/centcom/New()
|
||||
/obj/item/weapon/card/id/centcom/initialize()
|
||||
. = ..()
|
||||
access = get_all_centcom_access()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/card/id/centcom/station/New()
|
||||
..()
|
||||
/obj/item/weapon/card/id/centcom/station/initialize()
|
||||
. = ..()
|
||||
access |= get_all_station_access()
|
||||
|
||||
/obj/item/weapon/card/id/centcom/ERT
|
||||
@@ -187,8 +183,8 @@
|
||||
assignment = "Emergency Response Team"
|
||||
icon_state = "centcom"
|
||||
|
||||
/obj/item/weapon/card/id/centcom/ERT/New()
|
||||
..()
|
||||
/obj/item/weapon/card/id/centcom/ERT/initialize()
|
||||
. = ..()
|
||||
access |= get_all_station_access()
|
||||
|
||||
// Department-flavor IDs
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
var/electronic_warfare = 1
|
||||
var/mob/registered_user = null
|
||||
|
||||
/obj/item/weapon/card/id/syndicate/New(mob/user as mob)
|
||||
..()
|
||||
/obj/item/weapon/card/id/syndicate/initialize()
|
||||
. = ..()
|
||||
access = syndicate_access.Copy()
|
||||
|
||||
/obj/item/weapon/card/id/syndicate/station_access/New()
|
||||
..() // Same as the normal Syndicate id, only already has all station access
|
||||
/obj/item/weapon/card/id/syndicate/station_access/initialize()
|
||||
. = ..() // Same as the normal Syndicate id, only already has all station access
|
||||
access |= get_all_station_access()
|
||||
|
||||
/obj/item/weapon/card/id/syndicate/Destroy()
|
||||
|
||||
Reference in New Issue
Block a user