summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorWuzzy <wuzzy2@mail.ru>2017-09-08 18:39:02 +0200
committerSmallJoker <SmallJoker@users.noreply.github.com>2017-09-08 18:39:02 +0200
commite3093cbe857cca99b8f090922d6553bae90c3bf8 (patch)
tree84c400cb057194a34b72267f157af84b2f0320bd /builtin
parent151c95bb9bb324ef27df28bbd4f2bce944e35162 (diff)
downloadminetest-e3093cbe857cca99b8f090922d6553bae90c3bf8.tar.gz
minetest-e3093cbe857cca99b8f090922d6553bae90c3bf8.tar.bz2
minetest-e3093cbe857cca99b8f090922d6553bae90c3bf8.zip
Prevent /spawnentity from spawning unknown entity (#6388)
Diffstat (limited to 'builtin')
-rw-r--r--builtin/game/chatcommands.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/game/chatcommands.lua b/builtin/game/chatcommands.lua
index 05b814d6f..81cb76eaf 100644
--- a/builtin/game/chatcommands.lua
+++ b/builtin/game/chatcommands.lua
@@ -629,6 +629,9 @@ core.register_chatcommand("spawnentity", {
core.log("error", "Unable to spawn entity, player is nil")
return false, "Unable to spawn entity, player is nil"
end
+ if not minetest.registered_entities[entityname] then
+ return false, "Cannot spawn an unknown entity"
+ end
if p == "" then
p = player:getpos()
else