Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Fedja Beader
CSM
Commits
b694a790
Commit
b694a790
authored
Aug 02, 2021
by
Fedja Beader
Browse files
invnet: Try to figure out input list for unknown nodes
parent
be435f08
Changes
1
Hide whitespace changes
Inline
Side-by-side
inventory_networks/init.lua
View file @
b694a790
...
...
@@ -231,15 +231,23 @@ core.register_on_punchnode(function(pos, node)
l
:
info
(
"Unknown node punched: "
..
node
.
name
..
" adding it as source chest"
)
local
inv
=
core
.
get_inventory
(
pos
)
local
m
=
{}
if
inv
[
"src"
]
then
m
.
input_list_name
=
"src"
elseif
inv
[
"main"
]
then
m
.
input_list_name
=
"main"
end
if
inv
[
"dst"
]
then
m
.
output_list_name
=
"dst"
elseif
inv
[
"main"
]
then
m
.
output_list_name
=
"main"
end
if
m
.
output_list_name
then
if
m
.
input_list_name
and
m
.
output_list_name
then
m
.
pos
=
pos
invnet
.
machines
[
machine_index
]
=
m
else
l
:
err
(
" no inventory lists? Skipped adding."
)
end
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment