1
0
mirror of https://github.com/Sokomine/cottages.git synced 2026-01-11 03:26:23 +01:00

make some globals local

This commit is contained in:
tour
2025-09-07 16:10:53 +02:00
parent 93e714f92a
commit cb9bbb0989
4 changed files with 5 additions and 5 deletions

View File

@@ -17,7 +17,7 @@ local S = cottages.S
-----------------------------------------------------------------------------------------------------------
-- propagate shutting/closing of window shutters to window shutters below/above this one
cottages_window_sutter_operate = function( pos, old_node_state_name, new_node_state_name )
local cottages_window_sutter_operate = function( pos, old_node_state_name, new_node_state_name )
local offsets = {-1,1,-2,2,-3,3};
local stop_up = 0;
@@ -298,7 +298,7 @@ minetest.register_node("cottages:gate_open", {
-- hatches rotate around their axis
-- old facedir: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23
new_facedirs = { 10,19, 4,13, 2,18,22,14,20,16, 0,12,11, 3, 7,21, 9,23, 5, 1, 8,15, 6,17};
local new_facedirs = { 10,19, 4,13, 2,18,22,14,20,16, 0,12,11, 3, 7,21, 9,23, 5, 1, 8,15, 6,17};
cottages.register_hatch = function( nodename, description, texture, receipe_item )

View File

@@ -509,7 +509,7 @@ cottages.sleep_in_bed = function( pos, node, clicker, itemstack, pointed_thing )
-- search for a second mat right next to this one
local offset = {{x=0,z=-1}, {x=-1,z=0}, {x=0,z=1}, {x=1,z=0}};
for i,off in ipairs( offset ) do
node2 = minetest.get_node( {x=pos.x+off.x, y=pos.y, z=pos.z+off.z} );
local node2 = minetest.get_node( {x=pos.x+off.x, y=pos.y, z=pos.z+off.z} );
if( node2.name == 'cottages:sleeping_mat' or node2.name=='cottages:straw_mat' or node.name=='cottages:sleeping_mat_head' ) then
-- if a second mat is found, sleeping is possible
allow_sleep = true;

View File

@@ -8,7 +8,7 @@ local S = cottages.S
local add_hay_group = {"farming:straw", "dryplants:reed", "darkage:straw_bale"}
for i, v in ipairs(add_hay_group) do
if( minetest.registered_items[v]) then
new_groups = minetest.registered_items[v].groups
local new_groups = minetest.registered_items[v].groups
new_groups.hay = 3
minetest.override_item(v, {groups = new_groups})
end

View File

@@ -87,7 +87,7 @@ cottages.water_gen_fill_bucket = function(pos)
end
-- abort if the water has not been running long enough
-- (the player may have removed a bucket before it was full)
start = meta:get_string("fillstarttime")
local start = meta:get_string("fillstarttime")
if( (minetest.get_us_time()/1000000) - tonumber(start) < cottages.water_fill_time -2) then
return
end