Fixes secret sauce resseting too often and adds some logging.

This commit is contained in:
AnturK
2020-07-23 12:23:36 +02:00
parent cec6cbfa65
commit 7edae52ee1
2 changed files with 5 additions and 1 deletions
@@ -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")
@@ -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)