builtin: Correctly indicate failure in /spawnentity

This commit is contained in:
sfan5 2020-04-26 20:34:10 +02:00 committed by Loïc Blot
parent f6f6dd140f
commit d3f50f216f

@ -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,
})