Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Prevent /spawnentity from spawning unknown entity (#6388)
  • Loading branch information
Wuzzy2 authored and SmallJoker committed Sep 8, 2017
1 parent 151c95b commit e3093cb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions builtin/game/chatcommands.lua
Expand Up @@ -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
Expand Down

0 comments on commit e3093cb

Please sign in to comment.