From 70d2f6399d146982f93d61ef24b6b4e386447307 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Sun, 9 Dec 2018 18:51:10 +0000 Subject: [PATCH] fix nil error (thanks wziard) --- api.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api.lua b/api.lua index 96b33c0..749f2d3 100644 --- a/api.lua +++ b/api.lua @@ -6,7 +6,7 @@ local use_cmi = minetest.global_exists("cmi") mobs = { mod = "redo", - version = "20181204", + version = "20181209", intllib = S, invis = minetest.global_exists("invisibility") and invisibility or {}, } @@ -128,7 +128,9 @@ local collision = function(self) for _,object in ipairs(minetest.get_objects_inside_radius(pos, width)) do if object:is_player() - or (object:get_luaentity()._cmi_is_mob == true and object ~= self.object) then + or (object:get_luaentity() + and object:get_luaentity()._cmi_is_mob == true + and object ~= self.object) then local pos2 = object:get_pos() local vec = {x = pos.x - pos2.x, z = pos.z - pos2.z}