Skip to content

Allow a robot to stand in a ladder node above air+air #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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