[MIRROR] sane stacks (#11533)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-08-30 01:12:10 +02:00
committed by GitHub
co-authored by Kashargul Selis
parent 4797afe137
commit a272557ccd
21 changed files with 45 additions and 27 deletions
@@ -234,9 +234,7 @@
var/recursive = amount == -1 ? 1 : 0
var/datum/material/matdata = get_material_by_name(material_name)
var/stack_type = matdata.stack_type
var/obj/item/stack/material/S = new stack_type(loc)
if(amount <= 0)
amount = S.max_amount
var/obj/item/stack/material/S = new stack_type(loc, -1)
var/ejected = min(round(stored_material[material_name] / S.perunit), amount)
if(!S.set_amount(min(ejected, amount)))
return