diff options
author | ShadowNinja <shadowninja@minetest.net> | 2014-01-15 20:13:47 -0500 |
---|---|---|
committer | ShadowNinja <shadowninja@minetest.net> | 2014-01-15 20:13:47 -0500 |
commit | 54f9f78c4bee7923f5c389e41356c0c8f2d5ae48 (patch) | |
tree | 3bcc86b341250b3c8bc675ea287ec85329bf79cb | |
parent | ed7f57bf2f21af64039f07ac547ff676167b0ede (diff) |
Remove redundant if
-rw-r--r-- | internal.lua | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/internal.lua b/internal.lua index 658da6e..8a3634b 100644 --- a/internal.lua +++ b/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 |