Update preferences_savefile.dm

This commit is contained in:
timothyteakettle
2020-12-06 22:57:57 +00:00
parent e413fcb091
commit a84f1648f4

View File

@@ -265,7 +265,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
if(current_version < 47) //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++)
@@ -275,11 +274,15 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
message_admins("Failed to copy item [some_gear_item] to new loadout system when migrating from version [current_version] to 40, issue: item is not a path")
continue
var/datum/gear/gear_item = text2path(some_gear_item)
if(!initial(gear_item.loadout_initial_colors))
if(!(initial(gear_item.loadout_flags) & LOADOUT_CAN_COLOR_POLYCHROMIC))
message_admins("a")
loadout_data["SAVE_1"] += list(list(LOADOUT_ITEM = some_gear_item)) //for the migration we put their old save into the first save slot, which is loaded by default!
else
//the same but we setup some new polychromic data
loadout_data["SAVE_1"] += list(list(LOADOUT_ITEM = some_gear_item, LOADOUT_COLOR = initial(gear_item.loadout_initial_colors)))
message_admins("b")
//the same but we setup some new polychromic data (you can't get the initial value for a list so we have to do this horrible thing here)
var/datum/gear/temporary_gear_item = new gear_item
loadout_data["SAVE_1"] += list(list(LOADOUT_ITEM = some_gear_item, LOADOUT_COLOR = temporary_gear_item.loadout_initial_colors))
qdel(temporary_gear_item)
//it's double packed into a list because += will union the two lists contents
S["loadout"] = safe_json_encode(loadout_data)