Makes it plausible to use a list for geargroupid

This commit is contained in:
deathride58
2018-09-15 22:17:53 -04:00
parent 2b7af47717
commit 0152439145
2 changed files with 8 additions and 2 deletions
@@ -10,7 +10,7 @@
name = "Donor item testing bikehorn"
category = SLOT_IN_BACKPACK
path = /obj/item/bikehorn
geargroupID = "DONORTEST"
geargroupID = list("DONORTEST") //This is a list mainly for the sake of testing, but geargroupID works just fine with ordinary strings
/datum/gear/kevhorn
name = "Airhorn"
@@ -33,7 +33,13 @@ GLOBAL_LIST_EMPTY(loadout_whitelist_ids)
if(!GLOB.loadout_items[slot_to_string(I.category)])
LAZYINITLIST(GLOB.loadout_items[slot_to_string(I.category)])
LAZYSET(GLOB.loadout_items[slot_to_string(I.category)], I.name, I)
if(I.geargroupID in GLOB.loadout_whitelist_ids)
if(islist(I.geargroupID))
var/list/ggidlist = I.geargroupID
I.ckeywhitelist = list()
for(var/entry in ggidlist)
if(entry in GLOB.loadout_whitelist_ids)
I.ckeywhitelist |= GLOB.loadout_whitelist_ids["[entry]"]
else if(I.geargroupID in GLOB.loadout_whitelist_ids)
I.ckeywhitelist = GLOB.loadout_whitelist_ids["[I.geargroupID]"]