From 00187d7ff657f43f6fd1cc2e47c629e8a1abc2c3 Mon Sep 17 00:00:00 2001 From: sys4 Date: Sun, 5 May 2019 22:43:06 +0200 Subject: [PATCH] =?UTF-8?q?Corrige=20crash=20si=20objet=20non=20support?= =?UTF-8?q?=C3=A9=20=C3=A0=20recycler=20dans=20scie=20circulaire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- circular_saw.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/circular_saw.lua b/circular_saw.lua index 94e680e..894c986 100644 --- a/circular_saw.lua +++ b/circular_saw.lua @@ -242,6 +242,7 @@ 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 -- NALC Fix crash if cost == nil if (incost + cost) > maxcost then return math.max((maxcost - incost) / cost, 0) end