1
0
mirror of https://codeberg.org/tenplus1/mobs_redo.git synced 2024-12-23 17:20:22 +01:00

add falling sanity check

This commit is contained in:
TenPlus1 2020-04-07 08:36:57 +01:00
parent 610cef16f4
commit 4634288124

View File

@ -6,7 +6,7 @@ local use_cmi = minetest.global_exists("cmi")
mobs = {
mod = "redo",
version = "20200406",
version = "20200407",
intllib = S,
invis = minetest.global_exists("invisibility") and invisibility or {}
}
@ -2535,6 +2535,9 @@ function mob_class:falling(pos)
-- floating in water (or falling)
local v = self.object:get_velocity()
-- sanity check
if not v then return end
if v.y > 0 then
-- apply gravity when moving up