mirror of
https://github.com/minetest/minetest.git
synced 2024-12-23 22:52:25 +01:00
Prevent /spawnentity from spawning unknown entity (#6388)
This commit is contained in:
parent
151c95bb9b
commit
e3093cbe85
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user