forked from mtcontrib/arrow_signs
Fix placing shared locked signs in creative mode
This commit is contained in:
16
init.lua
16
init.lua
@ -15,6 +15,7 @@ arrow_signs={}
|
||||
|
||||
arrow_signs.formspec = "field[text;Sign text:;${text}]";
|
||||
|
||||
local creative = minetest.setting_getbool("creative_mode") or false
|
||||
arrow_signs.on_place = function(itemstack, placer, pointed_thing)
|
||||
|
||||
local posabove = pointed_thing.above
|
||||
@ -98,16 +99,15 @@ arrow_signs.on_place = function(itemstack, placer, pointed_thing)
|
||||
place = false
|
||||
end
|
||||
|
||||
if not(place) then
|
||||
minetest.rotate_node(itemstack, placer, pointed_thing)
|
||||
if place then
|
||||
if not creative then
|
||||
itemstack:take_item()
|
||||
end
|
||||
else
|
||||
itemstack:take_item()
|
||||
itemstack = minetest.rotate_node(itemstack, placer, pointed_thing)
|
||||
end
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
return itemstack
|
||||
end
|
||||
|
||||
|
||||
return itemstack
|
||||
end
|
||||
|
||||
arrow_signs.savetext = function(pos, formname, fields, sender)
|
||||
|
Reference in New Issue
Block a user