From 5566c00a697b9254d5bbe7285eb6cf5739b0213d Mon Sep 17 00:00:00 2001 From: timothyteakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Sun, 6 Dec 2020 17:24:12 +0000 Subject: [PATCH] fixes --- code/controllers/subsystem/job.dm | 2 +- code/modules/client/preferences.dm | 12 ++++++------ code/modules/client/preferences_savefile.dm | 5 +++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm index 661bf1921a..ccaaefeb03 100644 --- a/code/controllers/subsystem/job.dm +++ b/code/controllers/subsystem/job.dm @@ -675,7 +675,7 @@ SUBSYSTEM_DEF(job) if(!ishuman(M))//no silicons allowed return for(var/i in chosen_gear) - var/datum/gear/G = text2path(i[LOADOUT_ITEM]) + var/datum/gear/G = istext(i[LOADOUT_ITEM]) ? text2path(i[LOADOUT_ITEM]) : i[LOADOUT_ITEM] message_admins("category [initial(G.category)] and subcategory [initial(G.subcategory)] and name [initial(G.name)]") G = GLOB.loadout_items[initial(G.category)][initial(G.subcategory)][initial(G.name)] if(!G) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index f5b6becf55..6db21bbeeb 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -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, "You cannot take this loadout, as you've already chosen too many of the same category!") return @@ -2651,7 +2651,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) to_chat(user, "This is an item intended for donator use only. You are not authorized to use this item.") 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)]") diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index ba50f65b67..99ccfcc97e 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -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++)