summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2017-09-21 17:15:12 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2017-09-21 17:15:12 +0100
commit8517f4d946d5489f6f2993459c929420cd7cb671 (patch)
treee512f34e8040c14c0b23a9327e8c2365b5f33738
parent7c4dc07acde5ab6c4a828cde84a9e08754397e00 (diff)
fix abm's on_spawn
-rw-r--r--api.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/api.lua b/api.lua
index d524ece..0fe0e40 100644
--- a/api.lua
+++ b/api.lua
@@ -2909,14 +2909,17 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light,
if minetest.registered_entities[name] then
- minetest.add_entity(pos, name)
+ local mob = minetest.add_entity(pos, name)
--[[
print ("[mobs] Spawned " .. name .. " at "
.. minetest.pos_to_string(pos) .. " on "
.. node.name .. " near " .. neighbors[1])
]]
- if on_spawn and not on_spawn(mob, pos) then
- return
+ if on_spawn then
+
+ local ent = mob:get_luaentity()
+
+ on_spawn(ent, pos)
end
else
minetest.log("warning", string.format("[mobs] %s failed to spawn at %s",