mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 18:22:14 +00:00
Merge pull request #52435 from AnturK/notsosecret
Fixes secret sauce resetting too often and adds some logging.
This commit is contained in:
@@ -348,10 +348,14 @@ SUBSYSTEM_DEF(persistence)
|
|||||||
if(R.LoadOldRecipe(recipe_data) && (daysSince(R.created) <= R.persistence_period))
|
if(R.LoadOldRecipe(recipe_data) && (daysSince(R.created) <= R.persistence_period))
|
||||||
loaded = TRUE
|
loaded = TRUE
|
||||||
if(!loaded) //We do not have information for whatever reason, just generate new one
|
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()
|
R.GenerateRecipe()
|
||||||
|
|
||||||
if(!R.HasConflicts()) //Might want to try again if conflicts happened in the future.
|
if(!R.HasConflicts()) //Might want to try again if conflicts happened in the future.
|
||||||
add_chemical_reaction(R)
|
add_chemical_reaction(R)
|
||||||
|
else
|
||||||
|
log_game("Randomized recipe [randomized_type] resulted in conflicting recipes.")
|
||||||
|
|
||||||
/datum/controller/subsystem/persistence/proc/SaveRandomizedRecipes()
|
/datum/controller/subsystem/persistence/proc/SaveRandomizedRecipes()
|
||||||
var/json_file = file("data/RandomizedChemRecipes.json")
|
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()
|
var/list/possible_results = list()
|
||||||
|
|
||||||
/datum/chemical_reaction/randomized/proc/GenerateRecipe()
|
/datum/chemical_reaction/randomized/proc/GenerateRecipe()
|
||||||
created = world.time
|
created = world.realtime
|
||||||
if(randomize_container)
|
if(randomize_container)
|
||||||
required_container = pick(possible_containers)
|
required_container = pick(possible_containers)
|
||||||
if(randomize_req_temperature)
|
if(randomize_req_temperature)
|
||||||
|
|||||||
Reference in New Issue
Block a user