add sanity check to do_jump

This commit is contained in:
tenplus1 2020-04-11 17:46:07 +01:00
parent 92c899e6a4
commit dde9896a1a

View File

@ -6,7 +6,7 @@ local use_cmi = minetest.global_exists("cmi")
mobs = {
mod = "redo",
version = "20200407",
version = "20200411",
intllib = S,
invis = minetest.global_exists("invisibility") and invisibility or {}
}
@ -1007,6 +1007,9 @@ function mob_class:do_jump()
local pos = self.object:get_pos()
local yaw = self.object:get_yaw()
-- sanity check
if not yaw then return false end
-- what is mob standing on?
pos.y = pos.y + self.collisionbox[2] - 0.2