mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2024-12-24 01:30:22 +01:00
add falling sanity check
This commit is contained in:
parent
610cef16f4
commit
4634288124
5
api.lua
5
api.lua
@ -6,7 +6,7 @@ local use_cmi = minetest.global_exists("cmi")
|
|||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20200406",
|
version = "20200407",
|
||||||
intllib = S,
|
intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
invis = minetest.global_exists("invisibility") and invisibility or {}
|
||||||
}
|
}
|
||||||
@ -2535,6 +2535,9 @@ function mob_class:falling(pos)
|
|||||||
-- floating in water (or falling)
|
-- floating in water (or falling)
|
||||||
local v = self.object:get_velocity()
|
local v = self.object:get_velocity()
|
||||||
|
|
||||||
|
-- sanity check
|
||||||
|
if not v then return end
|
||||||
|
|
||||||
if v.y > 0 then
|
if v.y > 0 then
|
||||||
|
|
||||||
-- apply gravity when moving up
|
-- apply gravity when moving up
|
||||||
|
Loading…
Reference in New Issue
Block a user