mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-01-11 18:30:21 +01:00
fix abm's on_spawn
This commit is contained in:
parent
7c4dc07acd
commit
8517f4d946
9
api.lua
9
api.lua
@ -2909,14 +2909,17 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light,
|
|||||||
|
|
||||||
if minetest.registered_entities[name] then
|
if minetest.registered_entities[name] then
|
||||||
|
|
||||||
minetest.add_entity(pos, name)
|
local mob = minetest.add_entity(pos, name)
|
||||||
--[[
|
--[[
|
||||||
print ("[mobs] Spawned " .. name .. " at "
|
print ("[mobs] Spawned " .. name .. " at "
|
||||||
.. minetest.pos_to_string(pos) .. " on "
|
.. minetest.pos_to_string(pos) .. " on "
|
||||||
.. node.name .. " near " .. neighbors[1])
|
.. node.name .. " near " .. neighbors[1])
|
||||||
]]
|
]]
|
||||||
if on_spawn and not on_spawn(mob, pos) then
|
if on_spawn then
|
||||||
return
|
|
||||||
|
local ent = mob:get_luaentity()
|
||||||
|
|
||||||
|
on_spawn(ent, pos)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
minetest.log("warning", string.format("[mobs] %s failed to spawn at %s",
|
minetest.log("warning", string.format("[mobs] %s failed to spawn at %s",
|
||||||
|
Loading…
Reference in New Issue
Block a user