we can try

This commit is contained in:
Timothy Teakettle
2020-08-02 20:46:15 +01:00
parent f7093f2f84
commit c1f2ef3b38
+35 -3
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 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