From 7151b6877bb6e0ae0b566742e72e3a8dbeb04d99 Mon Sep 17 00:00:00 2001 From: crabman77 Date: Sun, 15 Mar 2015 01:49:35 +0100 Subject: [PATCH 1/3] fix megabuilder privs fix wrong test always false for megabuilder (nil~=false) --- mods/areas/internal.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/areas/internal.lua b/mods/areas/internal.lua index 9be59dc6..bad9fec3 100755 --- a/mods/areas/internal.lua +++ b/mods/areas/internal.lua @@ -144,7 +144,7 @@ function areas:canPlayerAddArea(pos1, pos2, name) local max_areas = privs.areas_high_limit and self.config.self_protection_max_areas_high or self.config.self_protection_max_areas - if count >= max_areas and minetest.get_player_privs(name)["megabuilder"] == false then + if count >= max_areas and minetest.get_player_privs(name)["megabuilder"] ~= true then return false, "You have reached the maximum amount of" .." areas that you are allowed to protect." end From ad693a8749706fb7d14c565f212fc4753671a9f2 Mon Sep 17 00:00:00 2001 From: crabman77 Date: Sun, 15 Mar 2015 15:26:17 +0100 Subject: [PATCH 2/3] fix megabuilder privs fix wrong test always false for megabuilder (nil~=false) --- mods/markers/init.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mods/markers/init.lua b/mods/markers/init.lua index 43f61f71..3e9c5125 100755 --- a/mods/markers/init.lua +++ b/mods/markers/init.lua @@ -185,7 +185,7 @@ markers.marker_placed = function( pos, placer, itemstack ) end -- make sure the list does not grow too large - if( n > markers.MAX_MARKERS and minetest.get_player_privs(name)["megabuilder"] == false) then + if( n > markers.MAX_MARKERS and minetest.get_player_privs(name)["megabuilder"] ~= true) then table.remove( markers.positions[ name ], 1 ); end end @@ -366,7 +366,7 @@ markers.get_marker_formspec = function(player, pos, error_msg) * (math.abs( coords[1].z - coords[2].z )+1); -- check if area is too large - if( markers.MAX_SIZE < size and minetest.get_player_privs(name)["megabuilder"] == false) then + if( markers.MAX_SIZE < size and minetest.get_player_privs(name)["megabuilder"] ~= true) then return formspec_info.."Error: You can only protect\nareas of up to "..tostring( markers.MAX_SIZE ).."m^2.\n".. "Your marked area is "..tostring( size ).." m^2 large.]"; end @@ -456,19 +456,19 @@ markers.marker_on_receive_fields = function(pos, formname, fields, sender) local add_depth = tonumber( fields['add_depth'] ); local error_msg = ''; - if( not( add_height ) or add_height < 0 or (add_height > markers.MAX_HEIGHT and minetest.get_player_privs(name)["megabuilder"] == false)) then + if( not( add_height ) or add_height < 0 or (add_height > markers.MAX_HEIGHT and minetest.get_player_privs(name)["megabuilder"] ~= true)) then minetest.chat_send_player( name, 'Please enter a number between 0 and '..tostring( markers.MAX_HEIGHT ).. ' in the field where the height of your area is requested. Your area will stretch that many blocks '.. 'up into the sky from the position of this marker onward.'); error_msg = 'The height value\nhas to be larger than 0\nand smaller than '..tostring( markers.MAX_HEIGHT ); - elseif( not( add_depth ) or add_depth < 0 or (add_depth > markers.MAX_HEIGHT and minetest.get_player_privs(name)["megabuilder"] == false)) then + elseif( not( add_depth ) or add_depth < 0 or (add_depth > markers.MAX_HEIGHT and minetest.get_player_privs(name)["megabuilder"] ~= true)) then minetest.chat_send_player( name, 'Please enter a number between 0 and '..tostring( markers.MAX_HEIGHT ).. ' in the field where the depth of your area is requested. Your area will stretch that many blocks '.. 'into the ground from the position of this marker onward.'); error_msg = 'The depth value\nhas to be larger than 0\nand smaller than '..tostring( markers.MAX_HEIGHT ); - elseif( add_height + add_depth > markers.MAX_HEIGHT ) and minetest.get_player_privs(name)["megabuilder"] == false then + elseif( add_height + add_depth > markers.MAX_HEIGHT ) and minetest.get_player_privs(name)["megabuilder"] ~= true then minetest.chat_send_player( name, 'Sorry, your area exceeds the height limit. Height and depth added have to '.. 'be smaller than '..tostring( markers.MAX_HEIGHT )..'.'); error_msg = 'height + depth has to\nbe smaller than '..tostring( markers.MAX_HEIGHT )..'.' From 2e565b2ab986b8c4ba3f8db22857f6f6566ced38 Mon Sep 17 00:00:00 2001 From: crabman77 Date: Sun, 15 Mar 2015 15:54:49 +0100 Subject: [PATCH 3/3] add privs interact to use chatcommands --- mods/soundset/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/soundset/init.lua b/mods/soundset/init.lua index 72876610..503dfe41 100644 --- a/mods/soundset/init.lua +++ b/mods/soundset/init.lua @@ -85,14 +85,14 @@ load_sounds_config() minetest.register_chatcommand("setsound", { params = " ", description = "set volume sound ", - privs = {}, + privs = {interact=true}, func = sounds.set_sound, }) minetest.register_chatcommand("getsound", { params = "", description = "print volume sound ", - privs = {}, + privs = {interact=true}, func = function(name, param) local conf = "" for k, v in pairs(sounds.gainplayers[name]) do