Merge pull request #14371 from Sneakyrat6/matContainer
Material container fixes
This commit is contained in:
@@ -47,7 +47,7 @@ GLOBAL_LIST_EMPTY(silo_access_logs)
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/ore_silo/proc/remote_attackby(obj/machinery/M, mob/user, obj/item/stack/I)
|
||||
/obj/machinery/ore_silo/proc/remote_attackby(obj/machinery/M, mob/user, obj/item/stack/I, remote = null)
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
// stolen from /datum/component/material_container/proc/OnAttackBy
|
||||
if(user.a_intent != INTENT_HELP)
|
||||
@@ -63,7 +63,7 @@ GLOBAL_LIST_EMPTY(silo_access_logs)
|
||||
return
|
||||
// assumes unlimited space...
|
||||
var/amount = I.amount
|
||||
materials.user_insert(I, user)
|
||||
materials.user_insert(I, user, remote)
|
||||
silo_log(M, "deposited", amount, "sheets", item_mats)
|
||||
return TRUE
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
stored_research = new
|
||||
host_research = SSresearch.science_tech
|
||||
update_research()
|
||||
materials = AddComponent(/datum/component/remote_materials, "lathe", mapload)
|
||||
materials = AddComponent(/datum/component/remote_materials, "lathe", mapload, _after_insert=CALLBACK(src, .proc/AfterMaterialInsert))
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/rnd/production/Destroy()
|
||||
|
||||
@@ -22,3 +22,6 @@
|
||||
/obj/machinery/rnd/production/circuit_imprinter/disconnect_console()
|
||||
linked_console.linked_imprinter = null
|
||||
..()
|
||||
|
||||
/obj/machinery/rnd/production/circuit_imprinter/AfterMaterialInsert() //doesnt use have an animation like lathes do
|
||||
return
|
||||
|
||||
@@ -94,13 +94,13 @@
|
||||
..()
|
||||
|
||||
/obj/machinery/rnd/proc/AfterMaterialInsert(item_inserted, id_inserted, amount_inserted)
|
||||
var/stack_name
|
||||
var/mat_name
|
||||
if(istype(item_inserted, /obj/item/stack/ore/bluespace_crystal))
|
||||
stack_name = "bluespace"
|
||||
mat_name = "bluespace"
|
||||
use_power(MINERAL_MATERIAL_AMOUNT / 10)
|
||||
else
|
||||
var/obj/item/stack/S = item_inserted
|
||||
stack_name = S.name
|
||||
var/datum/material/M = id_inserted
|
||||
mat_name = M.name
|
||||
use_power(min(1000, (amount_inserted / 100)))
|
||||
add_overlay("protolathe_[stack_name]")
|
||||
addtimer(CALLBACK(src, /atom/proc/cut_overlay, "protolathe_[stack_name]"), 10)
|
||||
add_overlay("protolathe_[mat_name]")
|
||||
addtimer(CALLBACK(src, /atom/proc/cut_overlay, "protolathe_[mat_name]"), 10)
|
||||
|
||||
Reference in New Issue
Block a user