From dfdd55848d6da32412a2df9745fc415b9b084cbe Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Thu, 25 Jun 2020 09:33:59 +0100 Subject: [PATCH] mobs:add_mob() returns object spawned or false if not --- api.lua | 4 ++-- api.txt | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/api.lua b/api.lua index 8e51049..ea630bc 100644 --- a/api.lua +++ b/api.lua @@ -6,7 +6,7 @@ local use_cmi = minetest.global_exists("cmi") mobs = { mod = "redo", - version = "20200622", + version = "20200625", intllib = S, invis = minetest.global_exists("invisibility") and invisibility or {} } @@ -3707,7 +3707,7 @@ function mobs:add_mob(pos, def) ent:update_tag() end - return true + return ent end diff --git a/api.txt b/api.txt index 0a5841e..e96d07b 100644 --- a/api.txt +++ b/api.txt @@ -339,6 +339,8 @@ Adding Mobs in World ignore_count = true -- ignores mob count per map area }) +Returns false if mob could not be added, returns mob object if spawned ok. + Spawning Mobs in World ----------------------