aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorBeha <shacknetisp@mail.com>2017-03-07 14:02:47 -0500
committerBeha <shacknetisp@mail.com>2017-03-07 14:02:47 -0500
commitf96ac5dcd9e09041060ad56d13b105440fe76212 (patch)
treee28c1d8734a92516451f408edfeac1fa3941593a /init.lua
parentb5e38e547d961e37d6a20b093709490de92ffcf8 (diff)
downloadelevator-f96ac5dcd9e09041060ad56d13b105440fe76212.tar.gz
elevator-f96ac5dcd9e09041060ad56d13b105440fe76212.tar.bz2
elevator-f96ac5dcd9e09041060ad56d13b105440fe76212.zip
Improved falling.
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index 657c77c..1a6b0b4 100644
--- a/init.lua
+++ b/init.lua
@@ -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 = {