diff options
| author | TenPlus1 <kinsellaja@yahoo.com> | 2017-09-21 17:15:12 +0100 | 
|---|---|---|
| committer | TenPlus1 <kinsellaja@yahoo.com> | 2017-09-21 17:15:12 +0100 | 
| commit | 8517f4d946d5489f6f2993459c929420cd7cb671 (patch) | |
| tree | e512f34e8040c14c0b23a9327e8c2365b5f33738 | |
| parent | 7c4dc07acde5ab6c4a828cde84a9e08754397e00 (diff) | |
fix abm's on_spawn
| -rw-r--r-- | api.lua | 9 | 
1 files changed, 6 insertions, 3 deletions
| @@ -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", | 
