From ce53bea7c022a998f45434cc5fbc4487185f4688 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 11 Aug 2016 18:34:46 +0200 Subject: [PATCH] Less namespace pollution --- init.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index eae068b..08de2b3 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,4 @@ +local S if (minetest.get_modpath("intllib")) then dofile(minetest.get_modpath("intllib").."/intllib.lua") S = intllib.Getter(minetest.get_current_modname()) @@ -177,8 +178,8 @@ end --[[ liquids ]] function pedology.register_liquid(basename, description, alpha, viscosity, drowning, damage_per_second, post_effect_color, additional_groups) - flowing_groups = {wet=6,not_in_creative_inventory=1} - source_groups = {wet=6} + local flowing_groups = {wet=6,not_in_creative_inventory=1} + local source_groups = {wet=6} for k,v in pairs(additional_groups) do flowing_groups[k] = v source_groups[k] = v @@ -296,6 +297,7 @@ function pedology.register_sucky(basename, description, wetness, oozing, sucky, -- If the node is not dry, do not add it into the creative inventory if wetness == 0 then noncreative = 0 else noncreative = 1 end + local on_construct, on_destruct if pedology.USE_DRIPS == 2 then on_construct = function(pos) local dripper = pedology.drip_particle(pos, wetness) @@ -312,7 +314,7 @@ function pedology.register_sucky(basename, description, wetness, oozing, sucky, end end else - on_construct, after_destruct = nil + on_construct, on_destruct = nil end local nodedef = { description = S(description), @@ -351,7 +353,7 @@ end additional_groups: Either a table of tables of strings, a table of strings or nil. If it is nil, no additional groups will be added to all nodes. If it is a table, the strings are interpreted as group names which will be added to each node. If it is a table of tables strings, you can specify the groups tables for each wetness level (start with index number 0 for dry). ]] function pedology.register_sucky_group(basename, basedescription, lumpbasedescription, maxwet, maxlump, oozeinterval, oozechance, melttable, dropcount, sounds, additional_groups) - local oozing, dripinterval + local sucky, oozing, dripinterval local m -- melting_point local lumpdescription local groups