mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Make stack amount var private
This commit is contained in:
@@ -100,8 +100,7 @@ using metal and glass, it uses glass and reagents (usually sulphuric acid).
|
||||
if(materials[f] >= SHEET_MATERIAL_AMOUNT)
|
||||
var/path = getMaterialType(f)
|
||||
if(path)
|
||||
var/obj/item/stack/S = new path(loc)
|
||||
S.amount = round(materials[f] / SHEET_MATERIAL_AMOUNT)
|
||||
new path(loc, round(materials[f] / SHEET_MATERIAL_AMOUNT))
|
||||
..()
|
||||
|
||||
/obj/machinery/r_n_d/circuit_imprinter/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
|
||||
@@ -233,7 +233,7 @@
|
||||
new_item.matter[i] = new_item.matter[i] * mat_efficiency
|
||||
|
||||
/obj/machinery/r_n_d/protolathe/proc/eject_materials(var/material, var/amount) // 0 amount = 0 means ejecting a full stack; -1 means eject everything
|
||||
var/recursive = amount == -1 ? 1 : 0
|
||||
var/recursive = amount == -1 ? TRUE : FALSE
|
||||
material = lowertext(material)
|
||||
var/obj/item/stack/material/mattype
|
||||
var/datum/material/MAT = get_material_by_name(material)
|
||||
@@ -250,9 +250,7 @@
|
||||
if(amount <= 0)
|
||||
amount = S.max_amount
|
||||
var/ejected = min(round(materials[material] / S.perunit), amount)
|
||||
S.amount = min(ejected, amount)
|
||||
if(S.amount <= 0)
|
||||
qdel(S)
|
||||
if(!S.set_amount(ejected, amount))
|
||||
return
|
||||
materials[material] -= ejected * S.perunit
|
||||
if(recursive && materials[material] >= S.perunit)
|
||||
|
||||
@@ -38,6 +38,5 @@
|
||||
eject = amount == -1 ? eject : min(eject, amount)
|
||||
if(eject < 1)
|
||||
return
|
||||
var/obj/item/stack/material/S = new sheetType(loc)
|
||||
S.amount = eject
|
||||
new sheetType(loc, eject)
|
||||
materials[material] -= eject * perUnit
|
||||
|
||||
Reference in New Issue
Block a user