From 7edae52ee1323e9041e216127c19f6dc89098c8f Mon Sep 17 00:00:00 2001 From: AnturK Date: Thu, 23 Jul 2020 12:23:36 +0200 Subject: [PATCH] Fixes secret sauce resseting 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..2e64651528e 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_world("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_world("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)