aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2020-05-01 18:22:02 +0200
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2020-05-01 18:22:02 +0200
commit80c492fd23b3ac930d0786bd55c4e7e475fb26ce (patch)
tree03fa1f47431a8235e4549e072ecba8e2ba9b67c8 /init.lua
parentd2c68d4cbab27045ed0b61b55ecbab3f0347803f (diff)
downloadelevator-80c492fd23b3ac930d0786bd55c4e7e475fb26ce.tar.gz
elevator-80c492fd23b3ac930d0786bd55c4e7e475fb26ce.tar.bz2
elevator-80c492fd23b3ac930d0786bd55c4e7e475fb26ce.zip
Make elevators less deadly, add farming_undo support
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index 89e9b02..eee4d8a 100644
--- a/init.lua
+++ b/init.lua
@@ -314,6 +314,10 @@ local box_entity = {
for y=self.lastpos.y,pos.y,((self.lastpos.y > pos.y) and -0.3 or 0.3) do
local p = vector.round({x=pos.x, y=y, z=pos.z})
local node = get_node(p)
+ if vector.distance(p,self.target) < elevator.SLOW_DIST then
+ self.object:set_velocity({x=0, y=elevator.SLOW_SPEED*self.vmult, z=0})
+ end
+
if node.name == "elevator:shaft" then
-- Nothing, just continue on our way.
elseif node.name == "elevator:elevator_on" or node.name == "elevator:elevator_off" then