Skip to content
Permalink
Browse files

builtin: Correctly indicate failure in /spawnentity

  • Loading branch information
sfan5 authored and nerzhul committed Apr 27, 2020
1 parent f6f6dd1 commit d3f50f216f051186bcac34c7383829e1e7b929ff
Showing with 3 additions and 2 deletions.
  1. +3 −2 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,
})

0 comments on commit d3f50f2

Please sign in to comment.