From 040b6472b48f47fa69e1849a0d32e4432671cd84 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Wed, 18 Sep 2019 01:21:18 +0200 Subject: [PATCH 1/3] FUCK --- code/modules/client/preferences_savefile.dm | 61 ++------------------- 1 file changed, 6 insertions(+), 55 deletions(-) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index c900349843..fcaf7769e5 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 22 +#define SAVEFILE_VERSION_MAX 23 /* SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn @@ -49,62 +49,13 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car pda_style = "mono" if(current_version < 20) pda_color = "#808000" - if(current_version < 21) - job_preferences = list() //It loaded null from nonexistant savefile field. - var/job_civilian_high = 0 - var/job_civilian_med = 0 - var/job_civilian_low = 0 - - var/job_medsci_high = 0 - var/job_medsci_med = 0 - var/job_medsci_low = 0 - - var/job_engsec_high = 0 - var/job_engsec_med = 0 - var/job_engsec_low = 0 - - S["job_civilian_high"] >> job_civilian_high - S["job_civilian_med"] >> job_civilian_med - S["job_civilian_low"] >> job_civilian_low - S["job_medsci_high"] >> job_medsci_high - S["job_medsci_med"] >> job_medsci_med - S["job_medsci_low"] >> job_medsci_low - S["job_engsec_high"] >> job_engsec_high - S["job_engsec_med"] >> job_engsec_med - S["job_engsec_low"] >> job_engsec_low - - //Can't use SSjob here since this happens right away on login - for(var/job in subtypesof(/datum/job)) - var/datum/job/J = job - var/new_value - var/fval = initial(J.flag) - switch(initial(J.department_flag)) - if(CIVILIAN) - if(job_civilian_high & fval) - new_value = JP_HIGH - else if(job_civilian_med & fval) - new_value = JP_MEDIUM - else if(job_civilian_low & fval) - new_value = JP_LOW - if(MEDSCI) - if(job_medsci_high & fval) - new_value = JP_HIGH - else if(job_medsci_med & fval) - new_value = JP_MEDIUM - else if(job_medsci_low & fval) - new_value = JP_LOW - if(ENGSEC) - if(job_engsec_high & fval) - new_value = JP_HIGH - else if(job_engsec_med & fval) - new_value = JP_MEDIUM - else if(job_engsec_low & fval) - new_value = JP_LOW - if(new_value) - job_preferences[initial(J.title)] = new_value - if((current_version < 22) && features["meat_type"] && (features["meat_type"] == null)) + if((current_version < 21) && features["meat_type"] && (features["meat_type"] == null)) features["meat_type"] = "Mammalian" +//if you are wondering why we are skipping current_verion 22, that's because of some huge fuck ups that caused the game to be unplayable that we are fixing here. + if(current_version < 23) + job_preferences = list() //It loaded null from nonexistant savefile field. + /datum/preferences/proc/load_path(ckey,filename="preferences.sav") if(!ckey) return From 63fbf225a6fd82fbe880a973e9f005eb9b865511 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Wed, 18 Sep 2019 01:24:44 +0200 Subject: [PATCH 2/3] aaaaa --- code/modules/client/preferences_savefile.dm | 56 ++++++++++++++++++++- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index fcaf7769e5..a72122a6c8 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -51,9 +51,61 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car pda_color = "#808000" if((current_version < 21) && features["meat_type"] && (features["meat_type"] == null)) features["meat_type"] = "Mammalian" + var/itsallogre = TRUE + if(current_version < 22) + var/job_civilian_high = 0 + var/job_civilian_med = 0 + var/job_civilian_low = 0 -//if you are wondering why we are skipping current_verion 22, that's because of some huge fuck ups that caused the game to be unplayable that we are fixing here. - if(current_version < 23) + var/job_medsci_high = 0 + var/job_medsci_med = 0 + var/job_medsci_low = 0 + + var/job_engsec_high = 0 + var/job_engsec_med = 0 + var/job_engsec_low = 0 + + S["job_civilian_high"] >> job_civilian_high + S["job_civilian_med"] >> job_civilian_med + S["job_civilian_low"] >> job_civilian_low + S["job_medsci_high"] >> job_medsci_high + S["job_medsci_med"] >> job_medsci_med + S["job_medsci_low"] >> job_medsci_low + S["job_engsec_high"] >> job_engsec_high + S["job_engsec_med"] >> job_engsec_med + S["job_engsec_low"] >> job_engsec_low + + //Can't use SSjob here since this happens right away on login + for(var/job in subtypesof(/datum/job)) + var/datum/job/J = job + var/new_value + var/fval = initial(J.flag) + switch(initial(J.department_flag)) + if(CIVILIAN) + if(job_civilian_high & fval) + new_value = JP_HIGH + else if(job_civilian_med & fval) + new_value = JP_MEDIUM + else if(job_civilian_low & fval) + new_value = JP_LOW + if(MEDSCI) + if(job_medsci_high & fval) + new_value = JP_HIGH + else if(job_medsci_med & fval) + new_value = JP_MEDIUM + else if(job_medsci_low & fval) + new_value = JP_LOW + if(ENGSEC) + if(job_engsec_high & fval) + new_value = JP_HIGH + else if(job_engsec_med & fval) + new_value = JP_MEDIUM + else if(job_engsec_low & fval) + new_value = JP_LOW + if(new_value) + job_preferences[initial(J.title)] = new_value + itsallogre = FALSE + if(current_version < 23 && itsallogre) // we are fixing a gamebreaking bug. job_preferences = list() //It loaded null from nonexistant savefile field. /datum/preferences/proc/load_path(ckey,filename="preferences.sav") From 150da1d34a66fe53cdf6ea9c448a694217af96e1 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Wed, 18 Sep 2019 01:37:17 +0200 Subject: [PATCH 3/3] code quality --- code/modules/client/preferences_savefile.dm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index a72122a6c8..2ba98caa56 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -51,7 +51,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car pda_color = "#808000" if((current_version < 21) && features["meat_type"] && (features["meat_type"] == null)) features["meat_type"] = "Mammalian" - var/itsallogre = TRUE if(current_version < 22) var/job_civilian_high = 0 var/job_civilian_med = 0 @@ -104,8 +103,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car new_value = JP_LOW if(new_value) job_preferences[initial(J.title)] = new_value - itsallogre = FALSE - if(current_version < 23 && itsallogre) // we are fixing a gamebreaking bug. + else if(current_version < 23) // we are fixing a gamebreaking bug. job_preferences = list() //It loaded null from nonexistant savefile field. /datum/preferences/proc/load_path(ckey,filename="preferences.sav")