From 4bf19c1a6e6a07cf8982df76c93fb8a124ceb53f Mon Sep 17 00:00:00 2001 From: skoglol <33292112+kriskog@users.noreply.github.com> Date: Sat, 25 Jul 2020 19:22:32 +0200 Subject: [PATCH 1/2] Merge pull request #52435 from AnturK/notsosecret Fixes secret sauce resetting too often and adds some logging. --- code/controllers/subsystem/persistence.dm | 4 ++++ code/modules/reagents/chemistry/recipes/special.dm | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/code/controllers/subsystem/persistence.dm b/code/controllers/subsystem/persistence.dm index 2e2ba59e9c5..a303b13927b 100644 --- a/code/controllers/subsystem/persistence.dm +++ b/code/controllers/subsystem/persistence.dm @@ -348,10 +348,14 @@ SUBSYSTEM_DEF(persistence) if(R.LoadOldRecipe(recipe_data) && (daysSince(R.created) <= R.persistence_period)) loaded = TRUE if(!loaded) //We do not have information for whatever reason, just generate new one + if(R.persistent) + log_game("Resetting persistent [randomized_type] random recipe.") R.GenerateRecipe() if(!R.HasConflicts()) //Might want to try again if conflicts happened in the future. add_chemical_reaction(R) + else + log_game("Randomized recipe [randomized_type] resulted in conflicting recipes.") /datum/controller/subsystem/persistence/proc/SaveRandomizedRecipes() var/json_file = file("data/RandomizedChemRecipes.json") diff --git a/code/modules/reagents/chemistry/recipes/special.dm b/code/modules/reagents/chemistry/recipes/special.dm index 57b813f086c..9774d3ecfc3 100644 --- a/code/modules/reagents/chemistry/recipes/special.dm +++ b/code/modules/reagents/chemistry/recipes/special.dm @@ -54,7 +54,7 @@ GLOBAL_LIST_INIT(food_reagents, build_reagents_to_food()) //reagentid = related var/list/possible_results = list() /datum/chemical_reaction/randomized/proc/GenerateRecipe() - created = world.time + created = world.realtime if(randomize_container) required_container = pick(possible_containers) if(randomize_req_temperature)