mirror of
https://github.com/minetest-mods/moreblocks.git
synced 2025-06-30 07:01:11 +02:00
Corrige crash si objet non supporté à recycler dans scie circulaire
This commit is contained in:
@ -242,6 +242,7 @@ function circular_saw.allow_metadata_inventory_put(
|
|||||||
local incost = (incount * 8) + microstack:get_count()
|
local incost = (incount * 8) + microstack:get_count()
|
||||||
local maxcost = (stackmax * 8) + 7
|
local maxcost = (stackmax * 8) + 7
|
||||||
local cost = circular_saw:get_cost(inv, stackname)
|
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
|
if (incost + cost) > maxcost then
|
||||||
return math.max((maxcost - incost) / cost, 0)
|
return math.max((maxcost - incost) / cost, 0)
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user