From 74b000aaad59d8353d688c45d9bf0a4173b9c1f8 Mon Sep 17 00:00:00 2001 From: SX Date: Sat, 5 Sep 2020 15:14:54 +0300 Subject: [PATCH] Make node_timeout local --- technic/machines/switching_station.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/technic/machines/switching_station.lua b/technic/machines/switching_station.lua index 6dacfec..328e606 100644 --- a/technic/machines/switching_station.lua +++ b/technic/machines/switching_station.lua @@ -214,26 +214,26 @@ local function traverse_network(PR_nodes, RE_nodes, BA_nodes, SP_nodes, all_node return true end -technic.node_timeout = {} +local node_timeout = {} technic.pos2network = function(pos) return technic.cables[minetest.hash_node_position(pos)] end technic.get_timeout = function(tier, pos) - if technic.node_timeout[tier] == nil then + if node_timeout[tier] == nil then -- it is normal that some multi tier nodes always drop here when checking all LV, MV and HV tiers return 0 end - return technic.node_timeout[tier][minetest.hash_node_position(pos)] or 0 + return node_timeout[tier][minetest.hash_node_position(pos)] or 0 end technic.touch_node = function(tier, pos, timeout) - if technic.node_timeout[tier] == nil then + if node_timeout[tier] == nil then -- this should get built up during registration - technic.node_timeout[tier] = {} + node_timeout[tier] = {} end - technic.node_timeout[tier][minetest.hash_node_position(pos)] = timeout or 2 + node_timeout[tier][minetest.hash_node_position(pos)] = timeout or 2 end local function touch_nodes(list, tier)