From: sfan5 Date: Sun, 26 Apr 2020 18:34:10 +0000 (+0200) Subject: builtin: Correctly indicate failure in /spawnentity X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d3f50f216f051186bcac34c7383829e1e7b929ff;p=oweals%2Fminetest.git builtin: Correctly indicate failure in /spawnentity --- 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, })