summaryrefslogtreecommitdiff
path: root/api.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2017-06-28 09:43:51 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2017-06-28 09:43:51 +0100
commitd74f2fa27bd322585a5d20fce762987bf4f9395c (patch)
tree76971f7a364e20fd118f9da7549ee7ff25f4e8d9 /api.lua
parent4ec4c388830f64a14120e2f3b52e3de9fb706a67 (diff)
falling velocity no longer exceeds self.fall_speed
Diffstat (limited to 'api.lua')
-rw-r--r--api.lua19
1 files changed, 8 insertions, 11 deletions
diff --git a/api.lua b/api.lua
index 09989b9..7ed45e6 100644
--- a/api.lua
+++ b/api.lua
@@ -1,9 +1,9 @@
--- Mobs Api (24th June 2017)
+-- Mobs Api (28th June 2017)
mobs = {}
mobs.mod = "redo"
-mobs.version = "20170624"
+mobs.version = "20170628"
-- Intllib
@@ -1942,14 +1942,17 @@ local falling = function(self, pos)
-- floating in water (or falling)
local v = self.object:getvelocity()
- -- going up then apply gravity
- if v.y > 0.1 then
+ if v.y > self.fall_speed then
+ -- fall downwards
self.object:setacceleration({
x = 0,
y = self.fall_speed,
z = 0
})
+ else
+ -- stop accelerating once max fall speed hit
+ self.object:setacceleration({x = 0, y = 0, z = 0})
end
-- in water then float up
@@ -1965,14 +1968,8 @@ local falling = function(self, pos)
})
end
else
- -- fall downwards
- self.object:setacceleration({
- x = 0,
- y = self.fall_speed,
- z = 0
- })
- -- fall damage
+ -- fall damage onto solid ground
if self.fall_damage == 1
and self.object:getvelocity().y == 0 then