diff options
author | sfan5 <sfan5@live.de> | 2020-04-26 20:34:10 +0200 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2020-04-27 06:58:34 +0200 |
commit | d3f50f216f051186bcac34c7383829e1e7b929ff (patch) | |
tree | 506399d4c9c0b107922ac6137239d087097381ad | |
parent | f6f6dd140f14a40a43a63a1ba3eccc66fd56d514 (diff) | |
download | minetest-d3f50f216f051186bcac34c7383829e1e7b929ff.tar.gz minetest-d3f50f216f051186bcac34c7383829e1e7b929ff.tar.bz2 minetest-d3f50f216f051186bcac34c7383829e1e7b929ff.zip |
builtin: Correctly indicate failure in /spawnentity
-rw-r--r-- | builtin/game/chat.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/game/chat.lua b/builtin/game/chat.lua index b3edda0d2..a71f4b329 100644 --- a/builtin/game/chat.lua +++ b/builtin/game/chat.lua @@ -736,8 +736,9 @@ core.register_chatcommand("spawnentity", { end end p.y = p.y + 1 - core.add_entity(p, entityname) - return true, ("%q spawned."):format(entityname) + local obj = core.add_entity(p, entityname) + local msg = obj and "%q spawned." or "%q failed to spawn." + return true, msg:format(entityname) end, }) |