local non_directional_activator = function(pos)
if pool[pos.x] and pool[pos.x][pos.y] and pool[pos.x][pos.y][pos.z] then
temp_pool = pool[pos.x][pos.y][pos.z]
- for _,order in pairs(order) do
- n_pos = add_vec(pos,order)
- if pool[n_pos.x] and pool[n_pos.x][n_pos.y] and pool[n_pos.x][n_pos.y][n_pos.z] then
- temp_pool2 = pool[n_pos.x][n_pos.y][n_pos.z]
- if temp_pool2 then
- if (not temp_pool2.directional_activator and temp_pool2.torch) or
- (temp_pool2.dust and temp_pool2.dust > 0) or
- (temp_pool2.torch_directional and vector.equals(temp_pool2.output, pos)) then
- if activator_table[temp_pool.name].activate then
- activator_table[temp_pool.name].activate(pos)
+ if temp_pool then
+ for _,order in pairs(order) do
+ n_pos = add_vec(pos,order)
+ if pool[n_pos.x] and pool[n_pos.x][n_pos.y] and pool[n_pos.x][n_pos.y][n_pos.z] then
+ temp_pool2 = pool[n_pos.x][n_pos.y][n_pos.z]
+ if temp_pool2 then
+ if (not temp_pool2.directional_activator and temp_pool2.torch) or
+ (temp_pool2.dust and temp_pool2.dust > 0) or
+ (temp_pool2.torch_directional and vector.equals(temp_pool2.output, pos)) then
+ if activator_table[temp_pool.name] and activator_table[temp_pool.name].activate then
+ activator_table[temp_pool.name].activate(pos)
+ end
+ return
end
- return
end
end
+ end
+ if activator_table[temp_pool.name] and activator_table[temp_pool.name].deactivate then
+ activator_table[temp_pool.name].deactivate(pos)
end
- end
- if activator_table[temp_pool.name].deactivate then
- activator_table[temp_pool.name].deactivate(pos)
end
end
end