projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f6f6dd1
)
builtin: Correctly indicate failure in /spawnentity
author
sfan5
<sfan5@live.de>
Sun, 26 Apr 2020 18:34:10 +0000
(20:34 +0200)
committer
Loïc Blot
<nerzhul@users.noreply.github.com>
Mon, 27 Apr 2020 04:58:34 +0000
(06:58 +0200)
builtin/game/chat.lua
patch
|
blob
|
history
diff --git
a/builtin/game/chat.lua
b/builtin/game/chat.lua
index b3edda0d2f9c406c20dff22bb46c5cfc713d2bf0..a71f4b3294a020f0b3f2c9f6684432fef3cb4bc9 100644
(file)
--- 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,
})