Skip to content

Commit

Permalink
builtin: Correctly indicate failure in /spawnentity
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 authored and nerzhul committed Apr 27, 2020
1 parent f6f6dd1 commit d3f50f2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions builtin/game/chat.lua
Expand Up @@ -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,
})

Expand Down

0 comments on commit d3f50f2

Please sign in to comment.