mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-15 01:54:52 +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:
@@ -16,7 +16,7 @@
|
||||
/// What sound plays when a thing operates?
|
||||
var/usage_sound = 'sound/machines/mining/wooping_teleport.ogg'
|
||||
/// Silo link to its materials list.
|
||||
var/datum/component/remote_materials/silo_materials
|
||||
var/datum/remote_materials/silo_materials
|
||||
/// Mining points held by the machine for miners.
|
||||
var/points_held = 0
|
||||
///The action verb to display to players
|
||||
@@ -30,8 +30,8 @@
|
||||
/obj/machinery/bouldertech/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
silo_materials = AddComponent(
|
||||
/datum/component/remote_materials, \
|
||||
silo_materials = new (
|
||||
src, \
|
||||
mapload, \
|
||||
mat_container_flags = MATCONTAINER_NO_INSERT \
|
||||
)
|
||||
@@ -46,7 +46,7 @@
|
||||
AddElement(/datum/element/connect_loc, loc_connections)
|
||||
|
||||
/obj/machinery/bouldertech/Destroy()
|
||||
silo_materials = null
|
||||
QDEL_NULL(silo_materials)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/bouldertech/on_deconstruction(disassembled)
|
||||
|
||||
Reference in New Issue
Block a user