diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index a2d6497b9d..6f906d927a 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -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)