[MIRROR] Techweb Fixes (#11299)

Co-authored-by: ShadowLarkens <shadowlarkens@gmail.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-08-04 15:36:43 -07:00
committed by GitHub
parent 399e4948e8
commit ac77b94d4b
29 changed files with 518 additions and 805 deletions

View File

@@ -364,16 +364,23 @@
// Modified quick_empty verb drops appropriate sized stacks
/obj/item/storage/bag/sheetsnatcher/quick_empty()
. = list()
var/location = get_turf(src)
for(var/obj/item/stack/material/S in contents)
var/cur_amount = S.get_amount()
var/full_stacks = round(cur_amount / S.max_amount) // Floor of current/max is amount of full stacks we make
var/remainder = cur_amount % S.max_amount // Current mod max is remainder after full sheets removed
for(var/i = 1 to full_stacks)
new S.type(location, S.max_amount)
. += new S.type(location, S.max_amount)
if(remainder)
new S.type(location, remainder)
. += new S.type(location, remainder)
S.set_amount(0)
for(var/mob/M in is_seeing)
if(!M.client || QDELETED(M))
hide_from(M)
else
M.client.screen -= S
orient2hud(usr)
if(usr.s_active)
usr.s_active.show_to(usr)