Merge pull request #55 from VOREStation/autolathe-21

Fixes #21 - Prevents making oversize stacks in autolathe.
This commit is contained in:
Arokha Sieyes
2016-05-14 14:10:08 -04:00
2 changed files with 6 additions and 1 deletions
+1
View File
@@ -102,6 +102,7 @@
//Build list of multipliers for sheets.
if(R.is_stack)
if(max_sheets && max_sheets > 0)
max_sheets = min(max_sheets, R.max_stack) // Limit to the max allowed by stack type.
multiplier_string += "<br>"
for(var/i = 5;i<max_sheets;i*=2) //5,10,20,40...
multiplier_string += "<a href='?src=\ref[src];make=[index];multiplier=[i]'>\[x[i]\]</a>"
+5 -1
View File
@@ -16,7 +16,10 @@
recipe.resources = list()
for(var/material in I.matter)
recipe.resources[material] = I.matter[material]*1.25 // More expensive to produce than they are to recycle.
qdel(I)
if(recipe.is_stack && istype(I, /obj/item/stack))
var/obj/item/stack/IS = I
recipe.max_stack = IS.max_amount
qdel(I)
/datum/autolathe/recipe
var/name = "object"
@@ -26,6 +29,7 @@
var/category
var/power_use = 0
var/is_stack
var/max_stack
/datum/autolathe/recipe/bucket
name = "bucket"