From faa944193a1b3e14392f12bca0d1f53e9d2d9b23 Mon Sep 17 00:00:00 2001 From: kay27 Date: Tue, 5 Jan 2021 23:30:59 +0400 Subject: [PATCH] try to fix https://git.minetest.land/Wuzzy/MineClone2/issues/963 --- mods/ENTITIES/mcl_mobs/api.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 8b86e4b9..0f5f59ae 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -276,8 +276,11 @@ end local get_velocity = function(self) local v = self.object:get_velocity() + if v then + return (v.x * v.x + v.z * v.z) ^ 0.5 + end - return (v.x * v.x + v.z * v.z) ^ 0.5 + return 0 end