mirror of
https://github.com/minetest/minetest.git
synced 2024-11-14 03:33:44 +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")
|
core.log("error", "Unable to spawn entity, player is nil")
|
||||||
return false, "Unable to spawn entity, player is nil"
|
return false, "Unable to spawn entity, player is nil"
|
||||||
end
|
end
|
||||||
|
if not minetest.registered_entities[entityname] then
|
||||||
|
return false, "Cannot spawn an unknown entity"
|
||||||
|
end
|
||||||
if p == "" then
|
if p == "" then
|
||||||
p = player:getpos()
|
p = player:getpos()
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user