Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,11 @@ basic_robot.commands.move = function(name,dir)
-- can move through walkable nodes
if minetest.registered_nodes[minetest.get_node(pos).name].walkable then return end
-- up; no levitation!
-- but a ladder in the target node will support a player, so also allow it to support a robot
if minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}).name == "air" and
minetest.get_node({x=pos.x,y=pos.y-2,z=pos.z}).name == "air" then
minetest.get_node({x=pos.x,y=pos.y-2,z=pos.z}).name == "air" and
minetest.get_node({x=pos.x,y=pos.y,z=pos.z}).name ~= "default:ladder_wood" and
minetest.get_node({x=pos.x,y=pos.y,z=pos.z}).name ~= "default:ladder_steel" then
return false
end

Expand Down Expand Up @@ -1551,4 +1554,4 @@ end
function Vplayer:get_eye_offset() end


-- code for act borrowed from: https://github.com/minetest-mods/pipeworks/blob/fa4817136c8d1e62dafd6ab694821cba255b5206/wielder.lua, line 372
-- code for act borrowed from: https://github.com/minetest-mods/pipeworks/blob/fa4817136c8d1e62dafd6ab694821cba255b5206/wielder.lua, line 372