diff --git a/mods/ambience_modpack/ambience/init.lua b/mods/ambience_modpack/ambience/init.lua index 11ae692e..3a14d97d 100755 --- a/mods/ambience_modpack/ambience/init.lua +++ b/mods/ambience_modpack/ambience/init.lua @@ -236,15 +236,15 @@ local is_daytime = function() end local nodes_in_range = function(pos, search_distance, node_name) - minp = {x=pos.x-search_distance,y=pos.y-search_distance, z=pos.z-search_distance} - maxp = {x=pos.x+search_distance,y=pos.y+search_distance, z=pos.z+search_distance} - nodes = minetest.find_nodes_in_area(minp, maxp, node_name) + local minp = {x=pos.x-search_distance,y=pos.y-search_distance, z=pos.z-search_distance} + local maxp = {x=pos.x+search_distance,y=pos.y+search_distance, z=pos.z+search_distance} + local nodes = minetest.find_nodes_in_area(minp, maxp, node_name) --minetest.chat_send_all("Found (" .. node_name .. ": " .. #nodes .. ")") return #nodes end local nodes_in_coords = function(minp, maxp, node_name) - nodes = minetest.find_nodes_in_area(minp, maxp, node_name) + local nodes = minetest.find_nodes_in_area(minp, maxp, node_name) --minetest.chat_send_all("Found (" .. node_name .. ": " .. #nodes .. ")") return #nodes end @@ -394,11 +394,11 @@ local get_ambience = function(player) -- minetest.chat_send_all("n3uf:" ..node_3_under_feet) -- local air_or_ignore = {air=true,ignore=true} - minp = {x=pos.x-3,y=pos.y-4, z=pos.z-3} - maxp = {x=pos.x+3,y=pos.y-1, z=pos.z+3} + local minp = {x=pos.x-3,y=pos.y-4, z=pos.z-3} + local maxp = {x=pos.x+3,y=pos.y-1, z=pos.z+3} local air_under_player = nodes_in_coords(minp, maxp, "air") local ignore_under_player = nodes_in_coords(minp, maxp, "ignore") - air_plus_ignore_under = air_under_player + ignore_under_player + local air_plus_ignore_under = air_under_player + ignore_under_player -- minetest.chat_send_all("airUnder:" ..air_under_player) -- minetest.chat_send_all("ignoreUnder:" ..ignore_under_player) -- minetest.chat_send_all("a+i:" ..air_plus_ignore_under) @@ -448,7 +448,7 @@ local get_ambience = function(player) end - desert_in_range = (nodes_in_range(pos, 6, "default:desert_sand")+nodes_in_range(pos, 6, "default:desert_stone")) + local desert_in_range = (nodes_in_range(pos, 6, "default:desert_sand")+nodes_in_range(pos, 6, "default:desert_stone")) --minetest.chat_send_all("desertcount: " .. desert_in_range .. ",".. pos.y ) if desert_in_range >250 then if music then diff --git a/mods/builtin_falling/func.lua b/mods/builtin_falling/func.lua index 478d2745..5d2a714e 100755 --- a/mods/builtin_falling/func.lua +++ b/mods/builtin_falling/func.lua @@ -1,6 +1,6 @@ function spawn_falling_node(p, node, owners) - obj = minetest.add_entity(p, "__builtin:falling_node") + local obj = minetest.add_entity(p, "__builtin:falling_node") obj:get_luaentity():set_node(node) obj:get_luaentity():set_owner(owners) end @@ -52,10 +52,10 @@ end -- function nodeupdate_single(p, delay) - n = minetest.get_node(p) + local n = minetest.get_node(p) if minetest.get_item_group(n.name, "falling_node") ~= 0 then - p_bottom = {x=p.x, y=p.y-1, z=p.z} - n_bottom = minetest.get_node(p_bottom) + local p_bottom = {x=p.x, y=p.y-1, z=p.z} + local n_bottom = minetest.get_node(p_bottom) -- Note: walkable is in the node definition, not in item groups if minetest.registered_nodes[n_bottom.name] and (minetest.get_item_group(n.name, "float") == 0 or diff --git a/mods/builtin_falling/rewirting.lua b/mods/builtin_falling/rewirting.lua index 5033c1e4..af78035d 100755 --- a/mods/builtin_falling/rewirting.lua +++ b/mods/builtin_falling/rewirting.lua @@ -29,7 +29,7 @@ minetest.register_entity(":__builtin:falling_node", { item_texture = minetest.registered_items[itemname].inventory_image item_type = minetest.registered_items[itemname].type end - prop = { + local prop = { is_visible = true, textures = {node.name}, } diff --git a/mods/builtin_item/init.lua b/mods/builtin_item/init.lua index cd58665f..b5fbd6c6 100755 --- a/mods/builtin_item/init.lua +++ b/mods/builtin_item/init.lua @@ -30,7 +30,7 @@ minetest.register_entity(":__builtin:item", { item_texture = minetest.registered_items[itemname].inventory_image item_type = minetest.registered_items[itemname].type end - prop = { + local prop = { is_visible = true, visual = "sprite", textures = {"unknown_item.png"} diff --git a/mods/gauges/init.lua b/mods/gauges/init.lua index f9134cbf..c2c66d0a 100755 --- a/mods/gauges/init.lua +++ b/mods/gauges/init.lua @@ -19,8 +19,8 @@ function hp_bar:on_step(dtime) self.object:remove() return end - hp = wielder:get_hp() - breath = wielder:get_breath() + local hp = wielder:get_hp() + local breath = wielder:get_breath() self.object:set_properties({textures = {"health_" .. tostring(hp) .. ".png^breath_" .. tostring(breath) .. ".png"}}) end diff --git a/mods/lavatemple/dagger.lua b/mods/lavatemple/dagger.lua index bdd3c5d1..e1e24f13 100755 --- a/mods/lavatemple/dagger.lua +++ b/mods/lavatemple/dagger.lua @@ -3,13 +3,13 @@ minetest.register_globalstep(function(dtime) local players = minetest.get_connected_players() for i,player in ipairs(players) do - target = lavatemple.mapgen_data.pos; + local target = lavatemple.mapgen_data.pos; if not target then return end - pos = player:getpos() - dir = player:get_look_yaw() + local pos = player:getpos() + local dir = player:get_look_yaw() local angle_north = math.deg(math.atan2(target.x - pos.x, target.z - pos.z)) if angle_north < 0 then angle_north = angle_north + 360 end - angle_dir = 90 - math.deg(dir) + local angle_dir = 90 - math.deg(dir) local angle_relative = (angle_north - angle_dir) % 360 local compass_image = math.floor((angle_relative/30) + 0.5)%12