mirror of
https://bitbucket.org/kingarthursteam/cannons.git
synced 2024-08-20 04:14:05 +02:00
Fix tonumber
This commit is contained in:
parent
3fa73d9d22
commit
1836df7205
@ -368,7 +368,7 @@ function cannons.on_ball_punch(pos, node, puncher, pointed_thing)
|
|||||||
end
|
end
|
||||||
local nodearr = string.split(node.name,"_stack_");
|
local nodearr = string.split(node.name,"_stack_");
|
||||||
local item = nodearr[1];
|
local item = nodearr[1];
|
||||||
local level = tonumber(nodearr[2]);
|
local level = tonumber(nodearr[2]) or 0;
|
||||||
puncher:get_inventory():add_item('main', item)
|
puncher:get_inventory():add_item('main', item)
|
||||||
if level > 1 then
|
if level > 1 then
|
||||||
node.name = item.."_stack_"..level-1
|
node.name = item.."_stack_"..level-1
|
||||||
|
Loading…
Reference in New Issue
Block a user