diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 59d99674eb..5d7be237a6 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 33 +#define SAVEFILE_VERSION_MAX 34 /* SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn @@ -200,6 +200,38 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car features["silicon_flavor_text"] = html_encode(features["silicon_flavor_text"]) features["ooc_notes"] = html_encode(features["ooc_notes"]) + if(current_version < 34) //convert to new loadout paths + var/list/saved_loadout_paths = splittext(S["loadout"], "|") + var/list/converted_paths = list() + for(var/datum/gear/i in saved_loadout_paths) + var/itemtype = copytext(i,13) + if(len(initial(i.ckeywhitelist))) + converted_paths += "/datum/gear/donator/[itemtype]" + else + switch(initial(i.slot)) + if(SLOT_W_UNIFORM) + converted_paths += "/datum/gear/uniform/[itemtype]" + if(SLOT_WEAR_SUIT) + converted_paths += "/datum/gear/suit/[itemtype]" + if(SLOT_SHOES) + converted_paths += "/datum/gear/shoes/[itemtype]" + if(SLOT_NECK) + converted_paths += "/datum/gear/neck/[itemtype]" + if(SLOT_WEAR_MASK) + converted_paths += "/datum/gear/mask/[itemtype]" + if(SLOT_HEAD) + converted_paths += "/datum/gear/head/[itemtype]" + if(SLOT_HANDS) + converted_paths += "/datum/gear/hands/[itemtype]" + if(SLOT_GLOVES) + converted_paths += "/datum/gear/gloves/[itemtype]" + if(SLOT_GLASSES) + converted_paths += "/datum/gear/glasses/[itemtype]" + if(CATEGORY_BACKPACK) + converted_paths += "/datum/gear/backpack/[itemtype]" + S["loadout"] = converted_paths.join("|") + + /datum/preferences/proc/load_path(ckey,filename="preferences.sav") if(!ckey) return @@ -224,7 +256,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car var/needs_update = savefile_needs_update(S) if(needs_update == -2) //fatal, can't load any data return 0 - + . = TRUE //general preferences @@ -443,7 +475,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car return 0 . = TRUE - + //Species var/species_id S["species"] >> species_id