Merge pull request #8355 from Atermonera/fix-sheet-dispenser-overflow

Fixes overflow bug that can delete sheets from smartfridge
This commit is contained in:
MistakeNot4892
2021-11-26 11:42:45 +11:00
committed by GitHub
2 changed files with 5 additions and 1 deletions
+2
View File
@@ -90,6 +90,8 @@
for(var/obj/item/stack/T as anything in instances)
if(count <= 0)
break
if(T.get_amount() <= count)
instances -= T
count -= T.transfer_to(S, count)
S.forceMove(product_location)
@@ -20,8 +20,10 @@
if(amount < 1)
return
count = min(count, amount)
while(count > 0)
var/obj/item/stack/S = I.get_product(get_turf(src), min(count, amount))
var/obj/item/stack/S = I.get_product(get_turf(src), count)
count -= S.amount
SStgui.update_uis(src)