diff --git a/README.md b/README.md index 5db5bad..f86494f 100644 --- a/README.md +++ b/README.md @@ -109,4 +109,3 @@ Copyright (C) 2013 ShadowNinja Licensed under the GNU LGPL version 2.1 or later. See LICENSE.txt and http://www.gnu.org/licenses/lgpl-2.1.txt - diff --git a/api.lua b/api.lua index 40a9841..e9543d6 100644 --- a/api.lua +++ b/api.lua @@ -1,6 +1,5 @@ local hudHandlers = {} - areas.registered_on_adds = {} areas.registered_on_removes = {} areas.registered_on_moves = {} @@ -17,13 +16,11 @@ function areas:registerOnMove(func) table.insert(areas.registered_on_moves, func) end - --- Adds a function as a HUD handler, it will be able to add items to the Areas HUD element. function areas:registerHudHandler(handler) table.insert(hudHandlers, handler) end - function areas:getExternalHudEntries(pos) local areas = {} for _, func in pairs(hudHandlers) do @@ -118,7 +115,7 @@ end -- Note that this fails and returns false when the specified area is fully -- owned by the player, but with multiple protection zones, none of which -- cover the entire checked area. --- @param name (optional) Player name. If not specified checks for any intersecting areas. +-- @param name (optional) Player name. If not specified checks for any intersecting areas. -- @param allow_open Whether open areas should be counted as if they didn't exist. -- @return Boolean indicating whether the player can interact in that area. -- @return Un-owned intersecting area ID, if found. diff --git a/chatcommands.lua b/chatcommands.lua index 9152e39..a40403e 100644 --- a/chatcommands.lua +++ b/chatcommands.lua @@ -75,8 +75,7 @@ minetest.register_chatcommand("add_owner", { .." positions that have already been protected," .." Use set_owner if you don't want the parent to be set."), func = function(name, param) - local pid, ownerName, areaName - = param:match('^(%d+) ([^ ]+) (.+)$') + local pid, ownerName, areaName = param:match('^(%d+) ([^ ]+) (.+)$') if not pid then minetest.chat_send_player(name, S("Invalid usage, see /help @1.", "add_owner")) @@ -294,7 +293,7 @@ if areas.factions_available then if not id then return false, S("Invalid usage, see /help @1.", "area_faction_open") end - + if not areas:isAreaOwner(id, name) then return false, S("Area @1 does not exist" .." or is not owned by you.", id) @@ -386,7 +385,7 @@ minetest.register_chatcommand("area_info", { area_num = area_num + 1 end end - table.insert(lines, S("You have @1 areas.", area_num)) + table.insert(lines, S("You have @1 areas.", area_num)) -- Area limit local area_limit_line = privs.areas and @@ -418,4 +417,3 @@ minetest.register_chatcommand("area_info", { return true, table.concat(lines, "\n") end, }) - diff --git a/hud.lua b/hud.lua index 9d13b80..8a2d352 100644 --- a/hud.lua +++ b/hud.lua @@ -4,7 +4,6 @@ areas.hud = {} areas.hud.refresh = 0 minetest.register_globalstep(function(dtime) - areas.hud.refresh = areas.hud.refresh + dtime if areas.hud.refresh > areas.config["tick"] then areas.hud.refresh = 0 @@ -69,4 +68,3 @@ end) minetest.register_on_leaveplayer(function(player) areas.hud[player:get_player_name()] = nil end) - diff --git a/init.lua b/init.lua index 53d4eb6..7f0ec41 100644 --- a/init.lua +++ b/init.lua @@ -25,7 +25,7 @@ minetest.register_privilege("areas", { description = "Can administer areas." }) minetest.register_privilege("areas_high_limit", { - description = "Can can more, bigger areas." + description = "Can protect more, bigger areas." }) if not minetest.registered_privileges[areas.config.self_protection_privilege] then @@ -38,4 +38,3 @@ if minetest.settings:get_bool("log_mods") then local diffTime = os.clock() - areas.startTime minetest.log("action", "areas loaded in "..diffTime.."s.") end - diff --git a/interact.lua b/interact.lua index 4e575fb..9cd44e2 100644 --- a/interact.lua +++ b/interact.lua @@ -17,4 +17,3 @@ minetest.register_on_protection_violation(function(pos, name) table.concat(owners, ", "))) end end) - diff --git a/internal.lua b/internal.lua index a7979e5..2db9541 100644 --- a/internal.lua +++ b/internal.lua @@ -48,7 +48,7 @@ end function areas:checkAreaStoreId(sid) if not sid then minetest.log("error", "AreaStore failed to find an ID for an " - .."area! Falling back to iterative area checking.") + .."area! Falling back to iterative area checking.") self.store = nil self.store_ids = nil end @@ -150,7 +150,6 @@ function areas:move(id, area, pos1, pos2) area.pos1 = pos1 area.pos2 = pos2 - for i=1, #areas.registered_on_moves do areas.registered_on_moves[i](id, area, pos1, pos2) end diff --git a/legacy.lua b/legacy.lua index c68afb2..eff281d 100644 --- a/legacy.lua +++ b/legacy.lua @@ -137,4 +137,3 @@ if areas.config.legacy_table then end }) end - diff --git a/locale/areas.fr.tr b/locale/areas.fr.tr index 52b08a9..4ca4c8d 100644 --- a/locale/areas.fr.tr +++ b/locale/areas.fr.tr @@ -86,7 +86,7 @@ Area is too big.=La zone est trop grande. Self protection is disabled or you do not have the necessary privilege.=L’autoprotection est désactivée ou vous n’avez pas le privilège nécessaire. -The area intersects with @1 [@2] (@3).=La zone a une intersection avec @1 [@2] (@3). +The area intersects with @1 [@2] (@3).=La zone a une intersection avec @1 [@2] (@3). You have reached the maximum amount of areas that you are allowed to protect.=Vous avez atteint le nombre maximum de zones que vous êtes autorisé à protéger. diff --git a/pos.lua b/pos.lua index 5ca92f6..7a9cbd2 100644 --- a/pos.lua +++ b/pos.lua @@ -1,4 +1,5 @@ local S = minetest.get_translator("areas") + -- I could depend on WorldEdit for this, but you need to have the 'worldedit' -- permission to use those commands and you don't have -- /area_pos{1,2} [X Y Z|X,Y,Z]. @@ -262,4 +263,3 @@ minetest.register_entity("areas:pos2", { areas.marker2[name] = nil end, }) - diff --git a/settings.lua b/settings.lua index 22af52c..17d290c 100644 --- a/settings.lua +++ b/settings.lua @@ -43,4 +43,3 @@ file:close() -------------- setting("filename", "string", world_path.."/areas.dat") - diff --git a/settingtypes.txt b/settingtypes.txt index 6316523..9abffa4 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -35,4 +35,3 @@ areas.self_protection_max_size_high (Maximal area size) v3f (512, 512, 512) # Only enter positive whole numbers for the coordinate values or you'll mess up stuff. # This setting applies for plyaers with the privilege 'areas_high_limit' areas.self_protection_max_areas_high (Maximal area count) float 32 -