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:
151c95b
)
Prevent /spawnentity from spawning unknown entity (#6388)
author
Wuzzy
<wuzzy2@mail.ru>
Fri, 8 Sep 2017 16:39:02 +0000
(18:39 +0200)
committer
SmallJoker
<SmallJoker@users.noreply.github.com>
Fri, 8 Sep 2017 16:39:02 +0000
(18:39 +0200)
builtin/game/chatcommands.lua
patch
|
blob
|
history
diff --git
a/builtin/game/chatcommands.lua
b/builtin/game/chatcommands.lua
index 05b814d6fdd30b92f563079104335eea32f4fd56..81cb76eafd6393cbf3c82de6d5710c53935995ca 100644
(file)
--- 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