From 0c87c3b0e0931e4106ae6bfd0c151749eb711727 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Mon, 28 Dec 2020 12:15:55 -0800 Subject: [PATCH] fiX --- code/__HELPERS/roundend.dm | 7 +++++-- .../subsystem/persistence/_persistence.dm | 19 +++++++++++++------ .../subsystem/persistence/cleanable_debris.dm | 2 +- .../ratvar_the_clockwork_justicar.dm | 1 + code/modules/power/singularity/narsie.dm | 1 + 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm index e4a2e6521a..a860a8cd3f 100644 --- a/code/__HELPERS/roundend.dm +++ b/code/__HELPERS/roundend.dm @@ -238,8 +238,11 @@ CHECK_TICK SSdbcore.SetRoundEnd() //Collects persistence features - if(mode.allow_persistence_save) - SSpersistence.CollectData() + if(mode.station_was_nuked) + SSpersistence.station_was_destroyed = TRUE + if(!mode.allow_persistence_save) + SSpersistence.station_persistence_save_disabled = TRUE + SSpersistence.CollectData() //stop collecting feedback during grifftime SSblackbox.Seal() diff --git a/code/controllers/subsystem/persistence/_persistence.dm b/code/controllers/subsystem/persistence/_persistence.dm index 4086fe6408..741d1dd72a 100644 --- a/code/controllers/subsystem/persistence/_persistence.dm +++ b/code/controllers/subsystem/persistence/_persistence.dm @@ -6,6 +6,11 @@ SUBSYSTEM_DEF(persistence) init_order = INIT_ORDER_PERSISTENCE flags = SS_NO_FIRE + /// Marks if the station got horribly destroyed + var/station_was_destroyed = FALSE + /// Marks if persistence save should be disabled + var/station_persistence_save_disabled = FALSE + var/list/obj/structure/chisel_message/chisel_messages = list() var/list/saved_messages = list() var/list/spawned_objects = list() @@ -37,45 +42,47 @@ SUBSYSTEM_DEF(persistence) /datum/controller/subsystem/persistence/proc/CollectData() SaveServerPersistence() + if(station_persistence_save_disabled) + return SaveGamePersistence() var/map_persistence_path = get_map_persistence_path() if(map_persistence_path) SaveMapPersistence() /** - * Loads persistent data relevant to the server: Configurations, past gamemodes, votes, etc + * Loads persistent data relevant to the server: Configurations, past gamemodes, votes, antag rep, etc */ /datum/controller/subsystem/persistence/proc/LoadServerPersistence() for(var/client/C in GLOB.clients) LoadSavedVote(C.ckey) if(CONFIG_GET(flag/use_antag_rep)) LoadAntagReputation() + LoadRandomizedRecipes() /** - * Saves persistent data relevant to the server: Configurations, past gamemodes, votes, etc + * Saves persistent data relevant to the server: Configurations, past gamemodes, votes, antag rep, etc */ /datum/controller/subsystem/persistence/proc/SaveServerPersistence() if(CONFIG_GET(flag/use_antag_rep)) CollectAntagReputation() + SaveRandomizedRecipes() /** - * Loads persistent data relevant to the game in general: Trophies, antag reputation, etc + * Loads persistent data relevant to the game in general: Photos, etc * * Legacy map persistence systems also use this. */ /datum/controller/subsystem/persistence/proc/LoadGamePersistence() LoadChiselMessages() LoadPhotoPersistence() - LoadRandomizedRecipes() LoadPaintings() /** - * Saves persistent data relevant to the game in general: Trophies, antag reputation, etc + * Saves persistent data relevant to the game in general: Photos, etc * * Legacy map persistence systems also use this. */ /datum/controller/subsystem/persistence/proc/SaveGamePersistence() - SaveRandomizedRecipes() CollectChiselMessages() SavePhotoPersistence() //THIS IS PERSISTENCE, NOT THE LOGGING PORTION. SavePaintings() diff --git a/code/controllers/subsystem/persistence/cleanable_debris.dm b/code/controllers/subsystem/persistence/cleanable_debris.dm index 80d10027a0..a0817c460b 100644 --- a/code/controllers/subsystem/persistence/cleanable_debris.dm +++ b/code/controllers/subsystem/persistence/cleanable_debris.dm @@ -86,7 +86,7 @@ /datum/controller/subsystem/persistence/proc/SaveMapDebris() if(fexists("[get_map_persistence_path()]/debris.json")) fdel("[get_map_persistence_path()]/debris.json") - if(CONFIG_GET(flag/persistent_debris_wipe_on_nuke) && SSticker?.mode?.station_was_nuked) + if(CONFIG_GET(flag/persistent_debris_wipe_on_nuke) && station_was_destroyed) return // local janitor cheers on nukeop team to save some work var/list/data = list() var/list/z_lookup = SSmapping.z_to_station_z_index diff --git a/code/modules/antagonists/clockcult/clock_structures/ratvar_the_clockwork_justicar.dm b/code/modules/antagonists/clockcult/clock_structures/ratvar_the_clockwork_justicar.dm index 73ae89a19b..28901ea0b2 100644 --- a/code/modules/antagonists/clockcult/clock_structures/ratvar_the_clockwork_justicar.dm +++ b/code/modules/antagonists/clockcult/clock_structures/ratvar_the_clockwork_justicar.dm @@ -30,6 +30,7 @@ var/mutable_appearance/alert_overlay = mutable_appearance('icons/effects/clockwork_effects.dmi', "ratvar_alert") notify_ghosts("The Justiciar's light calls to you! Reach out to Ratvar in [get_area_name(src)] to be granted a shell to spread his glory!", null, source = src, alert_overlay = alert_overlay) INVOKE_ASYNC(SSshuttle.emergency, /obj/docking_port/mobile/emergency.proc/request, null, 10, null, FALSE, 0) + SSpersistence.station_was_destroyed = TRUE /obj/structure/destructible/clockwork/massive/ratvar/Destroy() GLOB.ratvar_awakens-- diff --git a/code/modules/power/singularity/narsie.dm b/code/modules/power/singularity/narsie.dm index 8bf20fddc6..5b5292a020 100644 --- a/code/modules/power/singularity/narsie.dm +++ b/code/modules/power/singularity/narsie.dm @@ -78,6 +78,7 @@ set_security_level("delta") SSshuttle.registerHostileEnvironment(src) SSshuttle.lockdown = TRUE + SSpersistence.station_was_destroyed = TRUE sleep(600) if(resolved == FALSE) resolved = TRUE