aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2020-04-26 20:34:10 +0200
committerLoïc Blot <nerzhul@users.noreply.github.com>2020-04-27 06:58:34 +0200
commitd3f50f216f051186bcac34c7383829e1e7b929ff (patch)
tree506399d4c9c0b107922ac6137239d087097381ad /builtin
parentf6f6dd140f14a40a43a63a1ba3eccc66fd56d514 (diff)
downloadminetest-d3f50f216f051186bcac34c7383829e1e7b929ff.tar.gz
minetest-d3f50f216f051186bcac34c7383829e1e7b929ff.tar.bz2
minetest-d3f50f216f051186bcac34c7383829e1e7b929ff.zip
builtin: Correctly indicate failure in /spawnentity
Diffstat (limited to 'builtin')
-rw-r--r--builtin/game/chat.lua5
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,
})