From: Wuzzy Date: Fri, 8 Sep 2017 16:39:02 +0000 (+0200) Subject: Prevent /spawnentity from spawning unknown entity (#6388) X-Git-Tag: 5.0.0~848 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e3093cbe857cca99b8f090922d6553bae90c3bf8;p=oweals%2Fminetest.git Prevent /spawnentity from spawning unknown entity (#6388) --- 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