From 331c4e96d24ad1ca05d248b9716df6b653f8c46d Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Sat, 13 Jan 2018 20:11:07 +0000 Subject: [PATCH] fix selectionbox error when var missing --- api.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api.lua b/api.lua index 3c4db20..6ff28c2 100644 --- a/api.lua +++ b/api.lua @@ -3,7 +3,7 @@ mobs = {} mobs.mod = "redo" -mobs.version = "20180112" +mobs.version = "20180113" -- Intllib @@ -2366,6 +2366,8 @@ local mob_staticdata = function(self) -- remove mob when out of range unless tamed if remove_far and self.remove_ok + and self.type ~= "npc" + and self.state ~= "attack" and not self.tamed and self.lifetimer < 20000 then @@ -2446,6 +2448,11 @@ local mob_activate = function(self, staticdata, def, dtime) self.base_selbox = self.selectionbox end + -- for current mobs that dont have this set + if not self.base_selbox then + self.base_selbox = self.selectionbox or self.base_colbox + end + -- set texture, model and size local textures = self.base_texture local mesh = self.base_mesh