mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 20:45:28 +01:00
Fixes preferences resetting (#3104)
## About The Pull Request Fixes https://github.com/Bubberstation/Bubberstation/issues/2879 The reason for the issue seems rooted in skyrat's own port of the original json configs on tg (or perhaps the loads of changes they've made to it over the years). This pr patches it so that characters won't reset between rounds. original fixes by smartkar ## Why It's Good For The Game Guess ## Proof Of Testing <details> <summary>Screenshots/Videos</summary>  </details> It saves the character on creation and works fine after re-accessing the savefile ## Changelog 🆑 fixes: fixes the issue where characters would reset after a round or on switching character slots /🆑
This commit is contained in:
@@ -25,7 +25,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
*/
|
||||
/datum/preferences/proc/save_data_needs_update(list/save_data)
|
||||
if(!save_data) // empty list, either savefile isnt loaded or its a new char
|
||||
return -1
|
||||
return -3 // BUBBER EDIT
|
||||
if(save_data["version"] < SAVEFILE_VERSION_MIN)
|
||||
return -2
|
||||
if(save_data["version"] < SAVEFILE_VERSION_MAX)
|
||||
@@ -328,7 +328,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
all_quirks = SSquirks.filter_invalid_quirks(SANITIZE_LIST(all_quirks), augments)// SKYRAT EDIT - AUGMENTS+
|
||||
validate_quirks()
|
||||
|
||||
return TRUE
|
||||
return needs_update != -3 // BUBBER EDIT
|
||||
|
||||
/datum/preferences/proc/save_character(update) // Skyrat edit - Choose when to update (This is stupid)
|
||||
SHOULD_NOT_SLEEP(TRUE)
|
||||
@@ -343,7 +343,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
if (preference.savefile_identifier != PREFERENCE_CHARACTER)
|
||||
continue
|
||||
|
||||
if (!(preference.type in recently_updated_keys))
|
||||
if (!update && !(preference.type in recently_updated_keys)) // BUBBER EDIT
|
||||
continue
|
||||
|
||||
recently_updated_keys -= preference.type
|
||||
@@ -376,7 +376,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
if (!load_character(new_slot))
|
||||
tainted_character_profiles = TRUE
|
||||
randomise_appearance_prefs()
|
||||
save_character()
|
||||
save_character(TRUE) // BUBBER EDIT
|
||||
|
||||
for (var/datum/preference_middleware/preference_middleware as anything in middleware)
|
||||
preference_middleware.on_new_character(usr)
|
||||
|
||||
Reference in New Issue
Block a user