diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2018-09-28 09:11:30 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2018-09-28 09:11:30 +0100 |
commit | 6bf6e8fbd86764f5bb3a45a7ce0f17681d9c76da (patch) | |
tree | 6b01a8636ed00b60ab69278b5fa20c7e13a5ab29 | |
parent | afb7e01b918874b48fe7281166136c87d283d66c (diff) |
nil check on spawn collisionbox
-rw-r--r-- | api.lua | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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 |