From bcfc601c7a7d710366436a103204c4b29fd1e1a6 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Thu, 6 Aug 2020 23:11:09 -0700 Subject: [PATCH] sigh --- code/_globalvars/lists/loadout_categories.dm | 12 ++++++------ code/modules/client/preferences.dm | 13 ++++++------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/code/_globalvars/lists/loadout_categories.dm b/code/_globalvars/lists/loadout_categories.dm index 0a919b23ab..77d0fd73cd 100644 --- a/code/_globalvars/lists/loadout_categories.dm +++ b/code/_globalvars/lists/loadout_categories.dm @@ -1,13 +1,13 @@ GLOBAL_LIST_INIT(loadout_categories, list( LOADOUT_CATEGORY_BACKPACK = list(LOADOUT_SUBCATEGORY_BACKPACK_GENERAL, LOADOUT_SUBCATEGORY_BACKPACK_TOYS), LOADOUT_CATEGORY_NECK = list(LOADOUT_SUBCATEGORY_NECK_GENERAL, LOADOUT_SUBCATEGORY_NECK_TIE, LOADOUT_SUBCATEGORY_NECK_SCARVES), - LOADOUT_CATEGORY_MASK = LOADOUT_LOADOUT_SUBCATEGORY_NONE, - LOADOUT_CATEGORY_HANDS = LOADOUT_LOADOUT_SUBCATEGORY_NONE, + LOADOUT_CATEGORY_MASK = LOADOUT_SUBCATEGORY_NONE, + LOADOUT_CATEGORY_HANDS = LOADOUT_SUBCATEGORY_NONE, LOADOUT_CATEGORY_UNIFORM = list(LOADOUT_SUBCATEGORY_UNIFORM_GENERAL, LOADOUT_SUBCATEGORY_UNIFORM_JOBS, LOADOUT_SUBCATEGORY_UNIFORM_SUITS, LOADOUT_SUBCATEGORY_UNIFORM_SKIRTS, LOADOUT_SUBCATEGORY_UNIFORM_DRESSES, LOADOUT_SUBCATEGORY_UNIFORM_SWEATERS, LOADOUT_SUBCATEGORY_UNIFORM_PANTS, LOADOUT_SUBCATEGORY_UNIFORM_SHORTS), LOADOUT_CATEGORY_SUIT = list(LOADOUT_SUBCATEGORY_SUIT_GENERAL, LOADOUT_SUBCATEGORY_SUIT_COATS, LOADOUT_SUBCATEGORY_SUIT_JACKETS, LOADOUT_SUBCATEGORY_SUIT_JOBS), LOADOUT_CATEGORY_HEAD = list(LOADOUT_SUBCATEGORY_HEAD_GENERAL, LOADOUT_SUBCATEGORY_HEAD_JOBS), - LOADOUT_CATEGORY_SHOES = LOADOUT_LOADOUT_SUBCATEGORY_NONE, - LOADOUT_CATEGORY_GLOVES = LOADOUT_LOADOUT_SUBCATEGORY_NONE, - LOADOUT_CATEGORY_GLASSES = LOADOUT_LOADOUT_SUBCATEGORY_NONE, - LOADOUT_CATEGORY_DONATOR = LOADOUT_LOADOUT_SUBCATEGORY_NONE + LOADOUT_CATEGORY_SHOES = LOADOUT_SUBCATEGORY_NONE, + LOADOUT_CATEGORY_GLOVES = LOADOUT_SUBCATEGORY_NONE, + LOADOUT_CATEGORY_GLASSES = LOADOUT_SUBCATEGORY_NONE, + LOADOUT_CATEGORY_DONATOR = LOADOUT_SUBCATEGORY_NONE )) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index d6a128752a..1ec2e8867e 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1067,7 +1067,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if(!length(GLOB.loadout_items)) dat += "
ERROR: No loadout categories - something is horribly wrong!" else - gear_category = clamp(1, length(GLOB.loadout_items)) // no runtimes + gear_category = clamp(gear_category, 1, length(GLOB.loadout_items)) // no runtimes var/firstcat for(var/i in 1 to length(GLOB.loadout_items)) var/category = GLOB.loadout_items[i] @@ -1082,7 +1082,6 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "
" dat += "
" - dat += "
[gear_tab]
" dat += "
" dat += "
" @@ -1090,7 +1089,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if(!length(GLOB.loadout_categories[gear_category])) dat += "No subcategories detected. Something is horribly wrong!" else - gear_subcategory = clamp(1, length(GLOB.loadout_categories[gear_category])) + gear_subcategory = clamp(gear_subcategory, 1, length(GLOB.loadout_categories[gear_category])) var/firstsubcat for(var/i in 1 to length(GLOB.loadout_categories[gear_category])) @@ -1118,14 +1117,14 @@ GLOBAL_LIST_EMPTY(preferences_datums) continue var/class_link = "" if(gear.type in chosen_gear) - class_link = "style='white-space:normal;' class='linkOn' href='?_src_=prefs;preference=gear;toggle_gear_path=[html_encode(j)];toggle_gear=0'" + class_link = "style='white-space:normal;' class='linkOn' href='?_src_=prefs;preference=gear;toggle_gear_path=[html_encode(i)];toggle_gear=0'" else if(gear_points <= 0) class_link = "style='white-space:normal;' class='linkOff'" else if(donoritem) - class_link = "style='white-space:normal;background:#ebc42e;' href='?_src_=prefs;preference=gear;toggle_gear_path=[html_encode(j)];toggle_gear=1'" + class_link = "style='white-space:normal;background:#ebc42e;' href='?_src_=prefs;preference=gear;toggle_gear_path=[html_encode(i)];toggle_gear=1'" else - class_link = "style='white-space:normal;' href='?_src_=prefs;preference=gear;toggle_gear_path=[html_encode(j)];toggle_gear=1'" - dat += "[j]" + class_link = "style='white-space:normal;' href='?_src_=prefs;preference=gear;toggle_gear_path=[html_encode(i)];toggle_gear=1'" + dat += "[i]" dat += "[gear.cost]" if(islist(gear.restricted_roles)) if(gear.restricted_roles.len)