mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 04:26:03 +01:00
Cleans up chemical reaction & reagent look up code (#95281)
## About The Pull Request - Removed global list `fake_reagent_blacklist` in favour of `abstract_type`. Saved memory - Removed proc `get_chemical_reaction()` in favor of `GLOB.chemical_reaction_list`. No proc overhead and faster access - Remove unused proc `remove_chemical_reaction()` - Removed proc `find_reagent()` in favour of `GLOB.chemical_reagents_list`. No proc overhead and faster access - Directly access name of reagents via `::` operator from typepaths instead of looking up the datum in global chemical reagents list for some operations. Faster variable access - Removed unit test `reagent_id_typos`. The typepaths will error at compile time because they aren't strings so there's no need for this test ## Changelog 🆑 code: cleaned up code pertaining to reagent & reaction lookup /🆑
This commit is contained in:
@@ -13,8 +13,6 @@ PROCESSING_SUBSYSTEM_DEF(reagents)
|
||||
/datum/controller/subsystem/processing/reagents/Initialize()
|
||||
//So our first step isn't insane
|
||||
previous_world_time = world.time
|
||||
///Blacklists these reagents from being added to the master list. the exact type only. Children are not blacklisted.
|
||||
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()
|
||||
return SS_INIT_SUCCESS
|
||||
|
||||
Reference in New Issue
Block a user