mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
[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:
committed by
GitHub
parent
399e4948e8
commit
ac77b94d4b
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user