mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 13:10:02 +01:00
Refactors material components to regular datums (#94596)
## About The Pull Request This was LONG overdue and its finally time. Refactors 2 components to regular datums - `/datum/component/material_container` -> `/datum/material_container` - `/datum/component/remote_materials` -> `/datum/remote_materials` Reduced memory overhead and stops misuse of component i.e. storing it in a variable ## Changelog 🆑 refactor: refactored material container code to reduce memory overhead. Report bugs on github /🆑
This commit is contained in:
@@ -142,7 +142,7 @@
|
||||
///Proximity monitor associated with this atom, needed for proximity checks.
|
||||
var/datum/proximity_monitor/proximity_monitor
|
||||
///Material container for materials
|
||||
var/datum/component/material_container/materials
|
||||
var/datum/material_container/materials
|
||||
/// What can be input into the machine?
|
||||
var/accepted_type = /obj/item/stack
|
||||
|
||||
@@ -150,8 +150,8 @@
|
||||
. = ..()
|
||||
proximity_monitor = new(src, 1)
|
||||
|
||||
materials = AddComponent( \
|
||||
/datum/component/material_container, \
|
||||
materials = new ( \
|
||||
src, \
|
||||
SSmaterials.materials_by_category[MAT_CATEGORY_SILO], \
|
||||
INFINITY, \
|
||||
MATCONTAINER_EXAMINE, \
|
||||
@@ -163,7 +163,8 @@
|
||||
selected_material = GET_MATERIAL_REF(/datum/material/iron)
|
||||
|
||||
/obj/machinery/mineral/processing_unit/Destroy()
|
||||
materials = null
|
||||
QDEL_NULL(proximity_monitor)
|
||||
QDEL_NULL(materials)
|
||||
mineral_machine = null
|
||||
stored_research = null
|
||||
return ..()
|
||||
|
||||
Reference in New Issue
Block a user