harden spawn log message, better fix for nil checks
* reported, closes https://codeberg.org/tenplus1/mobs_redo/issues/1 referece at https://github.com/Archtec-io/bugtracker/issues/130 this are not so good so implement in better way. * related to commit bf79985730cee684a1e11e4b4df0ac140d7e8980 and commit a62bfe3828bf2d6889a71ab7d906c31641593663 atbf79985730
anda62bfe3828
This commit is contained in:
parent
4bf2555144
commit
d76d2d307a
16
api.lua
16
api.lua
@ -33,7 +33,7 @@ local use_mc2 = minetest.get_modpath("mcl_core")
|
||||
-- Global
|
||||
mobs = {
|
||||
mod = "redo",
|
||||
version = "20231012",
|
||||
version = "20231022",
|
||||
translate = S, intllib = S,
|
||||
invis = minetest.global_exists("invisibility") and invisibility or {},
|
||||
node_ice = "default:ice",
|
||||
@ -4196,14 +4196,16 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light, inter
|
||||
|
||||
local mob = minetest.add_entity(pos, name)
|
||||
|
||||
-- print("[mobs] Spawned " .. name .. " at "
|
||||
-- .. minetest.pos_to_string(pos) .. " on "
|
||||
-- .. node.name .. " near " .. neighbors[1])
|
||||
|
||||
if mob_log_spawn then
|
||||
|
||||
minetest.log("[MOBS] Spawned " .. name .. " at "
|
||||
.. minetest.pos_to_string(pos))
|
||||
local pos_string = pos and minetest.pos_to_string(pos) or ""
|
||||
|
||||
minetest.log(
|
||||
"[MOBS] Spawned "
|
||||
.. (name or "")
|
||||
.. " at "
|
||||
.. pos_string
|
||||
)
|
||||
end
|
||||
|
||||
if on_spawn and mob then
|
||||
|
Loading…
x
Reference in New Issue
Block a user