mirror of
https://github.com/APercy/airutils.git
synced 2025-03-21 18:41:21 +00:00
now user can move your own plane on area of another people
This commit is contained in:
parent
02714c3503
commit
996e650194
1 changed files with 12 additions and 1 deletions
|
@ -48,6 +48,9 @@ minetest.register_tool("airutils:tug", {
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local is_admin = false
|
||||||
|
is_admin = minetest.check_player_privs(player, {server=true})
|
||||||
|
|
||||||
local pos = player:get_pos()
|
local pos = player:get_pos()
|
||||||
local pname = player:get_player_name()
|
local pname = player:get_player_name()
|
||||||
|
|
||||||
|
@ -64,7 +67,15 @@ minetest.register_tool("airutils:tug", {
|
||||||
end]]--
|
end]]--
|
||||||
local is_protected = minetest.is_protected
|
local is_protected = minetest.is_protected
|
||||||
if is_protected then
|
if is_protected then
|
||||||
if not is_protected(pos, pname) then
|
local owner = nil
|
||||||
|
local object = pointed_thing.ref
|
||||||
|
if object then
|
||||||
|
local ent = object:get_luaentity()
|
||||||
|
if ent then
|
||||||
|
if ent.owner then owner = ent.owner end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not is_protected(pos, pname) or pname == owner or is_admin then
|
||||||
airutils.move_target(player, pointed_thing)
|
airutils.move_target(player, pointed_thing)
|
||||||
else
|
else
|
||||||
minetest.chat_send_player(pname,
|
minetest.chat_send_player(pname,
|
||||||
|
|
Loading…
Add table
Reference in a new issue