Fix ejecting from lathes through RND console (#47635)

Qust forgot to change this when he added the materials datums.
This commit is contained in:
skoglol
2019-11-09 09:15:54 -08:00
committed by Tad Hardesty
parent 5dfa6be687
commit c8289281e5
+14 -8
View File
@@ -392,10 +392,11 @@ Nothing else in the console has ID requirements.
for(var/mat_id in mat_container.materials)
var/datum/material/M = mat_id
var/amount = mat_container.materials[mat_id]
var/ref = REF(M)
l += "* [amount] of [M.name]: "
if(amount >= MINERAL_MATERIAL_AMOUNT) l += "<A href='?src=[REF(src)];ejectsheet=[M.id];eject_amt=1'>Eject</A> [RDSCREEN_NOBREAK]"
if(amount >= MINERAL_MATERIAL_AMOUNT*5) l += "<A href='?src=[REF(src)];ejectsheet=[M.id];eject_amt=5'>5x</A> [RDSCREEN_NOBREAK]"
if(amount >= MINERAL_MATERIAL_AMOUNT) l += "<A href='?src=[REF(src)];ejectsheet=[M.id];eject_amt=50'>All</A>[RDSCREEN_NOBREAK]"
if(amount >= MINERAL_MATERIAL_AMOUNT) l += "<A href='?src=[REF(src)];ejectsheet=[ref];eject_amt=1'>Eject</A> [RDSCREEN_NOBREAK]"
if(amount >= MINERAL_MATERIAL_AMOUNT*5) l += "<A href='?src=[REF(src)];ejectsheet=[ref];eject_amt=5'>5x</A> [RDSCREEN_NOBREAK]"
if(amount >= MINERAL_MATERIAL_AMOUNT) l += "<A href='?src=[REF(src)];ejectsheet=[ref];eject_amt=50'>All</A>[RDSCREEN_NOBREAK]"
l += ""
l += "</div>[RDSCREEN_NOBREAK]"
return l
@@ -526,10 +527,13 @@ Nothing else in the console has ID requirements.
for(var/mat_id in mat_container.materials)
var/datum/material/M = mat_id
var/amount = mat_container.materials[mat_id]
var/ref = REF(M)
l += "* [amount] of [M.name]: "
if(amount >= MINERAL_MATERIAL_AMOUNT) l += "<A href='?src=[REF(src)];imprinter_ejectsheet=[M.id];eject_amt=1'>Eject</A> [RDSCREEN_NOBREAK]"
if(amount >= MINERAL_MATERIAL_AMOUNT*5) l += "<A href='?src=[REF(src)];imprinter_ejectsheet=[M.id];eject_amt=5'>5x</A> [RDSCREEN_NOBREAK]"
if(amount >= MINERAL_MATERIAL_AMOUNT) l += "<A href='?src=[REF(src)];imprinter_ejectsheet=[M.id];eject_amt=50'>All</A>[RDSCREEN_NOBREAK]</div>"
if(amount >= MINERAL_MATERIAL_AMOUNT) l += "<A href='?src=[REF(src)];imprinter_ejectsheet=[ref];eject_amt=1'>Eject</A> [RDSCREEN_NOBREAK]"
if(amount >= MINERAL_MATERIAL_AMOUNT*5) l += "<A href='?src=[REF(src)];imprinter_ejectsheet=[ref];eject_amt=5'>5x</A> [RDSCREEN_NOBREAK]"
if(amount >= MINERAL_MATERIAL_AMOUNT) l += "<A href='?src=[REF(src)];imprinter_ejectsheet=[ref];eject_amt=50'>All</A>[RDSCREEN_NOBREAK]"
l += ""
l += "</div>[RDSCREEN_NOBREAK]"
return l
/obj/machinery/computer/rdconsole/proc/ui_techdisk() //Legacy code
@@ -947,7 +951,8 @@ Nothing else in the console has ID requirements.
if(!linked_lathe.materials.mat_container)
say("No material storage linked to protolathe!")
return
linked_lathe.eject_sheets(ls["ejectsheet"], ls["eject_amt"])
var/datum/material/M = locate(ls["ejectsheet"]) in linked_lathe.materials.mat_container.materials
linked_lathe.eject_sheets(M, ls["eject_amt"])
//Circuit Imprinter Materials
if(ls["disposeI"]) //Causes the circuit imprinter to dispose of a single reagent (all of it)
if(QDELETED(linked_imprinter))
@@ -966,7 +971,8 @@ Nothing else in the console has ID requirements.
if(!linked_imprinter.materials.mat_container)
say("No material storage linked to circuit imprinter!")
return
linked_imprinter.eject_sheets(ls["imprinter_ejectsheet"], ls["eject_amt"])
var/datum/material/M = locate(ls["imprinter_ejectsheet"]) in linked_imprinter.materials.mat_container.materials
linked_imprinter.eject_sheets(M, ls["eject_amt"])
if(ls["disk_slot"])
disk_slot_selected = text2num(ls["disk_slot"])
if(ls["research_node"])