Prevent players from placing flags below 50 y (#12)

This commit is contained in:
Coder12a 2018-12-07 19:23:42 -06:00 committed by Billy S
parent e726fa7725
commit 7df1063468

View File

@ -244,6 +244,13 @@ ctf_flag = {
return true return true
end end
if pos.y < -50 then
minetest.chat_send_player(name,
"Max flag depth is 50 blocks.")
minetest.set_node(pos, {name="air"})
return true
end
if not can_place_flag(pos) then if not can_place_flag(pos) then
minetest.chat_send_player(name, minetest.chat_send_player(name,
"Too close to the flag to build! Leave at least " .. r .. " blocks around the flag.") "Too close to the flag to build! Leave at least " .. r .. " blocks around the flag.")