diff options
author | ShadowNinja <shadowninja@minetest.net> | 2013-11-18 21:01:24 -0500 |
---|---|---|
committer | ShadowNinja <shadowninja@minetest.net> | 2013-11-18 21:12:09 -0500 |
commit | f096fb4dbbfae72d4669f6ea3a25823c16e2934d (patch) | |
tree | 914993a930937fcadadf258e32d8606ed0586a09 /init.lua | |
parent | f98312fe10b168eb4ba40c567075661e2f0060bf (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.lua | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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 |