This commit is contained in:
timothyteakettle
2020-12-06 17:24:12 +00:00
parent a478da678e
commit 5566c00a69
3 changed files with 10 additions and 9 deletions

View File

@@ -895,7 +895,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(donoritem && !gear.donator_ckey_check(user.ckey))
continue
var/class_link = ""
var/list/loadout_item = has_loadout_gear(loadout_slot, gear.type)
var/list/loadout_item = has_loadout_gear(loadout_slot, "[gear.type]")
var/extra_color_data = ""
if(loadout_item)
class_link = "style='white-space:normal;' class='linkOn' href='?_src_=prefs;preference=gear;toggle_gear_path=[html_encode(name)];toggle_gear=0'"
@@ -2641,9 +2641,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(!G)
return
var/toggle = text2num(href_list["toggle_gear"])
if(!toggle && has_loadout_gear(loadout_slot, G.type))//toggling off and the item effectively is in chosen gear)
remove_gear_from_loadout(loadout_slot, G.type)
else if(toggle && !(has_loadout_gear(loadout_slot, G.type)))
if(!toggle && has_loadout_gear(loadout_slot, "[G.type]"))//toggling off and the item effectively is in chosen gear)
remove_gear_from_loadout(loadout_slot, "[G.type]")
else if(toggle && !(has_loadout_gear(loadout_slot, "[G.type]")))
if(!is_loadout_slot_available(G.category))
to_chat(user, "<span class='danger'>You cannot take this loadout, as you've already chosen too many of the same category!</span>")
return
@@ -2651,7 +2651,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
to_chat(user, "<span class='danger'>This is an item intended for donator use only. You are not authorized to use this item.</span>")
return
if(gear_points >= initial(G.cost))
var/list/new_loadout_data = list(LOADOUT_ITEM = G.type)
var/list/new_loadout_data = list(LOADOUT_ITEM = "[G.type]")
if(length(G.loadout_initial_colors))
new_loadout_data[LOADOUT_COLOR] = G.loadout_initial_colors
if(loadout_data["SAVE_[loadout_slot]"])
@@ -2663,7 +2663,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/datum/gear/G = GLOB.loadout_items[gear_category][gear_subcategory][name]
if(!G)
return
var/user_gear = has_loadout_gear(loadout_slot, G.type)
var/user_gear = has_loadout_gear(loadout_slot, "[G.type]")
if(!user_gear)
return
message_admins("the gear is of length [length(user_gear)]")

View File

@@ -5,7 +5,7 @@
// You do not need to raise this if you are adding new values that have sane defaults.
// Only raise this value when changing the meaning/format/name/layout of an existing value
// where you would want the updater procs below to run
#define SAVEFILE_VERSION_MAX 40
#define SAVEFILE_VERSION_MAX 46
/*
SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn
@@ -226,9 +226,10 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
left_eye_color = "#BAB99E"
right_eye_color = "#BAB99E"
if(current_version < 40) //loadout save gets changed to json
if(current_version < 45) //loadout save gets changed to json
var/text_to_load
S["loadout"] >> text_to_load
message_admins("we're trying to load [text_to_load]")
var/list/saved_loadout_paths = splittext(text_to_load, "|")
//MAXIMUM_LOADOUT_SAVES save slots per loadout now
for(var/i=1, i<= MAXIMUM_LOADOUT_SAVES, i++)