Improves the "disable ERP" config (#16411)

* i'm stealing the erp

* h

* Apply suggestions from code review

Co-authored-by: Tastyfish <crazychris32@gmail.com>

Co-authored-by: Tastyfish <crazychris32@gmail.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
This commit is contained in:
Zonespace
2022-10-02 14:20:24 +00:00
committed by GitHub
co-authored by Tastyfish Gandalf
parent 846229cde2
commit 1481db3dab
14 changed files with 127 additions and 2 deletions
@@ -59,6 +59,11 @@ PROCESSING_SUBSYSTEM_DEF(quirks)
if(initial(quirk_type.abstract_parent_type) == type)
continue
// SKYRAT EDIT ADDITION START
if(initial(quirk_type.erp_quirk) && CONFIG_GET(flag/disable_erp_preferences))
continue
// SKYRAT EDIT ADDITION END
quirks[initial(quirk_type.name)] = quirk_type
quirk_points[initial(quirk_type.name)] = initial(quirk_type.value)
@@ -17,6 +17,19 @@ PROCESSING_SUBSYSTEM_DEF(reagents)
GLOB.fake_reagent_blacklist = list(/datum/reagent/medicine/c2, /datum/reagent/medicine, /datum/reagent/reaction_agent)
//Build GLOB lists - see holder.dm
build_chemical_reactions_lists()
// SKYRAT EDIT ADDITION START
if(CONFIG_GET(flag/disable_erp_preferences))
for(var/reaction_path in GLOB.chemical_reactions_list)
var/datum/chemical_reaction/reaction_datum = GLOB.chemical_reactions_list[reaction_path]
if(!reaction_datum.erp_reaction)
continue
GLOB.chemical_reactions_list -= reaction_path
for(var/reaction in reaction_datum.required_reagents)
var/list/reaction_list = GLOB.chemical_reactions_list_reactant_index[reaction]
if(reaction_list)
reaction_list -= reaction_datum
// SKYRAT EDIT ADDITION END
return SS_INIT_SUCCESS
/datum/controller/subsystem/processing/reagents/fire(resumed = FALSE)