aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOch Noe <och_noe@forksworld.de>2018-10-22 23:00:57 +0200
committerOch Noe <och_noe@forksworld.de>2018-10-22 23:00:57 +0200
commitd7620f7cb90dffeb07e7442d6e38c1e69081086e (patch)
treef7c2cbd9af15e2ae82599d0e0b64ab2742d77bc5
parentfdaa4dc1b8fef26efbea3feecb0b36db1622b316 (diff)
downloadmoreblocks-d7620f7cb90dffeb07e7442d6e38c1e69081086e.tar.gz
moreblocks-d7620f7cb90dffeb07e7442d6e38c1e69081086e.tar.bz2
moreblocks-d7620f7cb90dffeb07e7442d6e38c1e69081086e.zip
http://linux-forks.de/moreblocks/71.html fixed
-rw-r--r--circular_saw.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/circular_saw.lua b/circular_saw.lua
index b0a6d64..b0b039c 100644
--- a/circular_saw.lua
+++ b/circular_saw.lua
@@ -242,6 +242,9 @@ function circular_saw.allow_metadata_inventory_put(
local incost = (incount * 8) + microstack:get_count()
local maxcost = (stackmax * 8) + 7
local cost = circular_saw:get_cost(inv, stackname)
+ if not cost then
+ return 0
+ end
if (incost + cost) > maxcost then
return math.max((maxcost - incost) / cost, 0)
end