Removes recursion

This commit is contained in:
YPOQ
2018-05-09 17:37:03 -06:00
parent 6327b79db6
commit c26a19d523
+5 -6
View File
@@ -33,14 +33,13 @@
return
return TRUE
/obj/item/stack/Initialize(mapload, new_amount=null , merge = TRUE)
/obj/item/stack/Initialize(mapload, new_amount, merge = TRUE)
. = ..()
if(new_amount)
if(new_amount > max_amount)
amount = max_amount
new type(loc, new_amount - max_amount, merge)
else
amount = new_amount
amount = new_amount
while(amount > max_amount)
amount -= max_amount
new type(loc, max_amount, FALSE)
if(!merge_type)
merge_type = type
if(merge)