Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] General maintenance for Lathes #1873

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _maps/RandomRuins/IceRuins/icemoon_surface_engioutpost.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
/turf/open/floor/iron,
/area/ruin/planetengi)
"aA" = (
/obj/machinery/rnd/production/protolathe/department/engineering/no_tax,
/obj/machinery/rnd/production/protolathe/department/engineering,
/obj/effect/turf_decal/trimline/yellow/filled/warning{
dir = 9
},
Expand Down
2 changes: 1 addition & 1 deletion _maps/RandomRuins/SpaceRuins/nova/cargodiselost.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@
/obj/item/stack/sheet/glass/fifty,
/obj/item/circuitboard/machine/protolathe/offstation,
/obj/effect/spawner/random/engineering/toolbox,
/obj/item/circuitboard/machine/circuit_imprinter/department/no_tax,
/obj/item/circuitboard/machine/circuit_imprinter/department,
/obj/item/circuitboard/machine/rtg/advanced,
/obj/item/circuitboard/machine/rtg/advanced,
/obj/item/circuitboard/machine/rtg/advanced,
Expand Down
18 changes: 11 additions & 7 deletions code/datums/components/material/remote_materials.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ handles linking back and forth.
else
silo.holds -= src

/**
* Sets the storage size for local materials when not linked with silo
* Arguments
*
* * size - the new size for local storage. measured in SHEET_MATERIAL_SIZE units
*/
/datum/component/remote_materials/proc/set_local_size(size)
local_size = size
if (!silo && mat_container)
Expand Down Expand Up @@ -209,17 +215,15 @@ handles linking back and forth.
return check_z_level() ? silo.holds[src] : FALSE

/**
* Internal proc to check if this connection can use any materials from the silo
* Check if this connection can use any materials from the silo
* Returns true only if
* - The parent is of type movable atom
* - A mat container is actually present
* - The silo in not on hold
* Arguments
* * check_hold - should we check if the silo is on hold
*/
/datum/component/remote_materials/proc/_can_use_resource(check_hold = TRUE)
PRIVATE_PROC(TRUE)

/datum/component/remote_materials/proc/can_use_resource(check_hold = TRUE)
var/atom/movable/movable_parent = parent
if (!istype(movable_parent))
return FALSE
Expand All @@ -243,7 +247,7 @@ handles linking back and forth.
* name- For logging only. the design you are trying to build e.g. matter bin, etc.
*/
/datum/component/remote_materials/proc/use_materials(list/mats, coefficient = 1, multiplier = 1, action = "build", name = "design")
if(!_can_use_resource())
if(!can_use_resource())
return 0

var/amount_consumed = mat_container.use_materials(mats, coefficient, multiplier)
Expand All @@ -265,7 +269,7 @@ handles linking back and forth.
* [drop_target][atom]- optional where to drop the sheets. null means it is dropped at this components parent location
*/
/datum/component/remote_materials/proc/eject_sheets(datum/material/material_ref, eject_amount, atom/drop_target = null)
if(!_can_use_resource())
if(!can_use_resource())
return 0

var/atom/movable/movable_parent = parent
Expand All @@ -282,7 +286,7 @@ handles linking back and forth.
* * multiplier - the multiplier applied on the materials consumed
*/
/datum/component/remote_materials/proc/insert_item(obj/item/weapon, multiplier = 1)
if(!_can_use_resource(FALSE))
if(!can_use_resource(FALSE))
return MATERIAL_INSERT_ITEM_FAILURE

return mat_container.insert_item(weapon, multiplier, parent)
Loading
Loading