mirror of
https://github.com/minetest-mods/digtron.git
synced 2025-01-03 09:37:27 +01:00
auto_controller: Avoid nil error when digging slopes (#69)
Crashes otherwise if offset field is left empty. Related: https://github.com/minetest/minetest/issues/10180
This commit is contained in:
parent
eea743185d
commit
1c85c822e8
@ -270,6 +270,7 @@ minetest.register_node("digtron:auto_controller", {
|
||||
local node = minetest.get_node(pos)
|
||||
local controlling_coordinate = digtron.get_controlling_coordinate(pos, node.param2)
|
||||
|
||||
offset = offset or 0
|
||||
local newpos = pos
|
||||
local markerpos = {x=newpos.x, y=newpos.y, z=newpos.z}
|
||||
local x_pos = math.floor((newpos[controlling_coordinate]+offset)/slope)*slope - offset
|
||||
|
Loading…
Reference in New Issue
Block a user