From e3093cbe857cca99b8f090922d6553bae90c3bf8 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 8 Sep 2017 18:39:02 +0200 Subject: [PATCH] Prevent /spawnentity from spawning unknown entity (#6388) --- builtin/game/chatcommands.lua | 3 +++ 1 file changed, 3 insertions(+) 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