diff options
author | Beha <shacknetisp@mail.com> | 2017-03-07 14:02:47 -0500 |
---|---|---|
committer | Beha <shacknetisp@mail.com> | 2017-03-07 14:02:47 -0500 |
commit | f96ac5dcd9e09041060ad56d13b105440fe76212 (patch) | |
tree | e28c1d8734a92516451f408edfeac1fa3941593a | |
parent | b5e38e547d961e37d6a20b093709490de92ffcf8 (diff) |
Improved falling.
-rw-r--r-- | init.lua | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -145,7 +145,7 @@ local function unbuild(pos, add) p2.y = p2.y + add local motorhash = locate_motor(p2) build_motor(motorhash) - if boxes[motorhash] and minetest.string_to_pos(motorhash).y >= boxes[motorhash]:getpos().y then + if boxes[motorhash] and p2.y >= boxes[motorhash]:getpos().y then boxes[motorhash] = nil end end, table.copy(pos)) @@ -175,6 +175,7 @@ for _,mode in ipairs({"on", "off"}) do local nodename = "elevator:elevator_"..mode local on = (mode == "on") local box +local cbox if on then box = { @@ -186,6 +187,8 @@ if on then { -0.5,-0.5,-0.5,0.5,-0.48, 0.5}, { -0.5, 1.45,-0.5,0.5, 1.5, 0.5}, } + cbox = box + cbox[5] = nil else box = { @@ -202,6 +205,7 @@ else --{ -0.5,-0.5,-0.5,0.5,-0.48, 0.5}, --{ -0.5, 1.45,-0.5,0.5, 1.5, 0.5}, } + cbox = box end minetest.register_node(nodename, { description = "Elevator", @@ -220,7 +224,7 @@ minetest.register_node(nodename, { collision_box = { type = "fixed", - fixed = box, + fixed = cbox, }, node_box = { |