mirror of
https://codeberg.org/Wuzzy/pride_flags.git
synced 2025-03-22 16:02:20 +00:00
No longer need server priv to change flag, check protection instead
This commit is contained in:
parent
889744fc7a
commit
7698ceebd0
2 changed files with 22 additions and 18 deletions
|
@ -10,8 +10,7 @@ conspicuous location, such as atop a building or along a promenade.
|
||||||
/giveme pride_flags:mast_upper
|
/giveme pride_flags:mast_upper
|
||||||
|
|
||||||
Initially, the rainbow pride flag will appear when the upper mast is placed.
|
Initially, the rainbow pride flag will appear when the upper mast is placed.
|
||||||
Right-click or punch the node to select a different flag
|
Right-click or punch the node to select a different flag.
|
||||||
(this requires the "server" privilege).
|
|
||||||
|
|
||||||
|
|
||||||
Repository
|
Repository
|
||||||
|
|
9
init.lua
9
init.lua
|
@ -256,9 +256,15 @@ local function spawn_flag_and_set_texture( pos )
|
||||||
end
|
end
|
||||||
|
|
||||||
local function cycle_flag( pos, player, cycle_backwards )
|
local function cycle_flag( pos, player, cycle_backwards )
|
||||||
|
local pname = player:get_player_name( )
|
||||||
|
if minetest.is_protected( pos, pname ) and not
|
||||||
|
minetest.check_player_privs( pname, "protection_bypass") then
|
||||||
|
minetest.register_protection_violation( pos, pname )
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local node_idx = minetest.hash_node_position( pos )
|
local node_idx = minetest.hash_node_position( pos )
|
||||||
|
|
||||||
if minetest.check_player_privs( player:get_player_name( ), "server" ) then
|
|
||||||
local aflag = active_flags[ node_idx ]
|
local aflag = active_flags[ node_idx ]
|
||||||
local flag
|
local flag
|
||||||
if aflag then
|
if aflag then
|
||||||
|
@ -277,7 +283,6 @@ local function cycle_flag( pos, player, cycle_backwards )
|
||||||
spawn_flag_and_set_texture( pos )
|
spawn_flag_and_set_texture( pos )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
minetest.register_node( "pride_flags:upper_mast", {
|
minetest.register_node( "pride_flags:upper_mast", {
|
||||||
description = S("Flag Pole with Flag"),
|
description = S("Flag Pole with Flag"),
|
||||||
|
|
Loading…
Add table
Reference in a new issue