mirror of
https://github.com/minetest-mods/areas.git
synced 2024-11-14 22:50:19 +01:00
Remove redundant if
This commit is contained in:
parent
ed7f57bf2f
commit
54f9f78c4b
20
internal.lua
20
internal.lua
|
@ -124,19 +124,17 @@ function areas:canPlayerAddArea(pos1, pos2, name)
|
|||
end
|
||||
|
||||
-- Check number of areas the user has and make sure it not above the max
|
||||
if self.self_protection then
|
||||
local count = 0
|
||||
for _, area in pairs(self.areas) do
|
||||
if area.owner == name then
|
||||
count = count + 1
|
||||
end
|
||||
end
|
||||
if count > self.self_protection_max_areas then
|
||||
return false, "You have reached the maximum amount"
|
||||
.." of areas that you are allowed to"
|
||||
.." protect."
|
||||
local count = 0
|
||||
for _, area in pairs(self.areas) do
|
||||
if area.owner == name then
|
||||
count = count + 1
|
||||
end
|
||||
end
|
||||
if count > self.self_protection_max_areas then
|
||||
return false, "You have reached the maximum amount"
|
||||
.." of areas that you are allowed to"
|
||||
.." protect."
|
||||
end
|
||||
|
||||
-- Check intersecting areas
|
||||
for _, area in pairs(self.areas) do
|
||||
|
|
Loading…
Reference in New Issue
Block a user