This commit is contained in:
silicons
2020-08-06 23:11:09 -07:00
parent 8edb374a20
commit bcfc601c7a
2 changed files with 12 additions and 13 deletions
+6 -7
View File
@@ -1067,7 +1067,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(!length(GLOB.loadout_items))
dat += "<center>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 += "</b></center></td></tr>"
dat += "<tr><td colspan=4><hr></td></tr>"
dat += "<tr><td colspan=4><b><center>[gear_tab]</center></b></td></tr>"
dat += "<tr><td colspan=4><hr></td></tr>"
dat += "<tr><td colspan=4><center><b>"
@@ -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 += "<tr style='vertical-align:top;'><td width=15%><a [class_link]>[j]</a></td>"
class_link = "style='white-space:normal;' href='?_src_=prefs;preference=gear;toggle_gear_path=[html_encode(i)];toggle_gear=1'"
dat += "<tr style='vertical-align:top;'><td width=15%><a [class_link]>[i]</a></td>"
dat += "<td width = 5% style='vertical-align:top'>[gear.cost]</td><td>"
if(islist(gear.restricted_roles))
if(gear.restricted_roles.len)