summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2013-11-18 21:01:24 -0500
committerShadowNinja <shadowninja@minetest.net>2013-11-18 21:12:09 -0500
commitf096fb4dbbfae72d4669f6ea3a25823c16e2934d (patch)
tree914993a930937fcadadf258e32d8606ed0586a09 /init.lua
parentf98312fe10b168eb4ba40c567075661e2f0060bf (diff)
Use table indices as IDs
This significantly optimizes a lot of operations and removes redundancy.
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index d3ffd74..1aca354 100644
--- a/init.lua
+++ b/init.lua
@@ -21,12 +21,17 @@ areas:load()
minetest.register_privilege("areas", {description = "Can administer areas"})
if not minetest.registered_privileges[areas.self_protection_privilege] then
- minetest.register_privilege(areas.self_protection_privilege,
- {description = "Can protect areas"})
+ minetest.register_privilege(areas.self_protection_privilege, {
+ description = "Can protect areas",
+ })
+end
+
+for _, area in pairs(areas.areas) do
+ area.id = nil
end
if minetest.setting_getbool("log_mod") then
local diffTime = os.clock() - areas.startTime
- print("[areas] loaded in "..diffTime.."s.")
+ minetest.log("action", "areas loaded in "..diffTime.."s.")
end