Corrige crash si objet non supporté à recycler dans scie circulaire

This commit is contained in:
Sys Quatre 2019-05-05 22:43:06 +02:00
부모 6a6a22f699
커밋 00187d7ff6
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제

파일 보기

@ -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