From 1b2f2120ec26f66825393d14c9f0bc3ec1fbf72c Mon Sep 17 00:00:00 2001 From: ktccd Date: Fri, 11 Aug 2017 23:10:05 +0200 Subject: [PATCH] DO NOT MERGE - Fixes random resetting of file I did a bad with the direction of >> and <<. My bad. Fixed now, I will test FURTHER to confirm that old files are not deleted or ruined. --- code/modules/client/preferences_savefile.dm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 1240fa7fe3..60fd905df3 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -382,11 +382,15 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["feature_has_womb"] >> features["has_womb"] //flavor text //Let's make our players NOT cry desperately as we wipe their savefiles of their special snowflake texts: - if(S["flavor_text"] != "" || S["flavor_text"] != null) + if((S["flavor_text"] != "") && (S["flavor_text"] != null) && S["flavor_text"]) //If old text isn't null and isn't "" but still exists. + to_chat(world, "DEBUG: OLD TEXT FOUND, MOVING:[S["flavor_text"]]") S["flavor_text"] >> features["flavor_text"] //Load old flavortext as current dna-based flavortext - S["flavor_text"] >> S["feature_flavor_text"] //Save it in our new type of flavor-text - null >> S["flavor_text"] //Remove old flavortext, completing the cut-and-paste into the new format. + + S["feature_flavor_text"] << features["flavor_text"] //Save it in our new type of flavor-text + S["flavor_text"] << "" //Remove old flavortext, completing the cut-and-paste into the new format. + else //We have no old flavortext, default to new + to_chat(world, "DEBUG: No old text found.") S["feature_flavor_text"] >> features["flavor_text"]