From d3f50f216f051186bcac34c7383829e1e7b929ff Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sun, 26 Apr 2020 20:34:10 +0200 Subject: builtin: Correctly indicate failure in /spawnentity --- builtin/game/chat.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'builtin/game') 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, }) -- cgit v1.2.3