summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2018-09-28 09:11:30 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2018-09-28 09:11:30 +0100
commit6bf6e8fbd86764f5bb3a45a7ce0f17681d9c76da (patch)
tree6b01a8636ed00b60ab69278b5fa20c7e13a5ab29
parentafb7e01b918874b48fe7281166136c87d283d66c (diff)
nil check on spawn collisionbox
-rw-r--r--api.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/api.lua b/api.lua
index 7a7a930..e3d60e0 100644
--- a/api.lua
+++ b/api.lua
@@ -6,7 +6,7 @@ local use_cmi = minetest.global_exists("cmi")
mobs = {
mod = "redo",
- version = "20180915",
+ version = "20180928",
intllib = S,
invis = minetest.global_exists("invisibility") and invisibility or {},
}
@@ -3258,7 +3258,9 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light,
-- do we have enough height clearance to spawn mob?
local ent = minetest.registered_entities[name]
- local height = max(0, math.ceil(ent.collisionbox[5] - ent.collisionbox[2]) - 1)
+ local height = max(1, math.ceil(
+ (ent.collisionbox[5] or 0.25) -
+ (ent.collisionbox[2] or -0.25) - 1))
for n = 0, height do