From 46342881248c42007345799663b0f1fb24c5927a Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Tue, 7 Apr 2020 08:36:57 +0100 Subject: [PATCH] add falling sanity check --- api.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api.lua b/api.lua index 86e51d7..a019c79 100644 --- a/api.lua +++ b/api.lua @@ -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