This commit is contained in:
silicons
2020-08-06 23:39:57 -07:00
parent 3640a33ff6
commit 65839060c9
3 changed files with 8 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
//defines for loadout categories
//no category defines
#define LOADOUT_CATEGORY_NONE "ERROR"
#define LOADOUT_SUBCATEGORY_NONE "Miscellaneous"
#define LOADOUT_SUBCATEGORIES_NONE list("Miscellaneous")
//backpack

View File

@@ -1099,7 +1099,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += " |"
else
firstsubcat = FALSE
var/subcategory = GLOB.loadout_categories[chosen_subcategory][i]
var/subcategory = GLOB.loadout_categories[chosen_category][i]
if(gear_subcategory == i)
dat += " <span class='linkOn'>[subcategory]</span> "
chosen_subcategory = subcategory
@@ -1111,10 +1111,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "<td style='vertical-align:top'><b>Cost</b></td>"
dat += "<td width=10%><font size=2><b>Restrictions</b></font></td>"
dat += "<td width=80%><font size=2><b>Description</b></font></td></tr>"
for(var/i in GLOB.loadout_items[chosen_category][chosen_subcategory])
var/datum/gear/gear = GLOB.loadout_items[gear_category][gear_subcategory][i]
if(!gear.name)
continue
for(var/name in GLOB.loadout_items[chosen_category][chosen_subcategory])
var/datum/gear/gear = GLOB.loadout_items[chosen_category][chosen_subcategory][name]
var/donoritem = gear.donoritem
if(donoritem && !gear.donator_ckey_check(user.ckey))
continue

View File

@@ -27,7 +27,10 @@ GLOBAL_LIST_EMPTY(loadout_whitelist_ids)
/proc/initialize_global_loadout_items()
load_loadout_config()
for(var/item in subtypesof(/datum/gear))
var/datum/gear/I = new item
var/datum/gear/I = item
if(!initial(I.name))
continue
I = new item
LAZYINITLIST(GLOB.loadout_items[I.category])
LAZYINITLIST(GLOB.loadout_items[I.category][I.subcategory])
GLOB.loadout_items[I.category][I.subcategory][I.name] = I