mirror of
https://github.com/minetest-mods/towercrane.git
synced 2024-11-22 15:23:51 +01:00
player with creative privs can now dig the crane
This commit is contained in:
parent
8b76fcd33d
commit
d0af5b3c13
5
init.lua
5
init.lua
@ -433,7 +433,7 @@ minetest.register_node("towercrane:base", {
|
|||||||
if height ~= 0 then
|
if height ~= 0 then
|
||||||
meta:set_int("height", height)
|
meta:set_int("height", height)
|
||||||
meta:set_int("width", width)
|
meta:set_int("width", width)
|
||||||
meta:set_string("infotext", "Crane size: " .. height .. "," .. width)
|
meta:set_string("infotext", "Owner: ".. owner ..", Crane size: " .. height .. "," .. width)
|
||||||
if no_area_violation(owner, pos) then
|
if no_area_violation(owner, pos) then
|
||||||
if dir ~= nil then
|
if dir ~= nil then
|
||||||
if check_space(table.copy(pos), dir, height, width, owner) then
|
if check_space(table.copy(pos), dir, height, width, owner) then
|
||||||
@ -456,7 +456,8 @@ minetest.register_node("towercrane:base", {
|
|||||||
local switch_pos = {x=pos.x, y=pos.y+1, z=pos.z}
|
local switch_pos = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local owner = meta:get_string("owner")
|
local owner = meta:get_string("owner")
|
||||||
if player:get_player_name() ~= owner then
|
if player:get_player_name() ~= owner and
|
||||||
|
not minetest.check_player_privs(player:get_player_name(), "creative") then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
meta = minetest.get_meta(switch_pos)
|
meta = minetest.get_meta(switch_pos)
|
||||||
|
Loading…
Reference in New Issue
Block a user