Skip to content

Commit

Permalink
Prioritise virtual signals last in inventory combinator (#68)
Browse files Browse the repository at this point in the history
Some mods create virtual signals with the same name as items or fluids
leading to the inventory combinator outputing the virtual signal instead
of the correct item or fluid signal.  Move virtual signal test last to
prioritise fluids and items with a given name first.
  • Loading branch information
Hornwitser authored Nov 10, 2022
1 parent b121932 commit dd75530
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions src/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 1.99.15
Date: ??. ??. ????
Bugfixes:
- Fixed inventory combinator outputting virtual signals named the same as item or fluid signals.
---------------------------------------------------------------------------------------------------
Version: 1.99.12
Date: 09. 09. 2022
Features:
Expand Down
8 changes: 4 additions & 4 deletions src/control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -914,12 +914,12 @@ function UpdateInvCombinators()
for name, count in pairs(global.invdata) do
-- Combinator signals are limited to a max value of 2^31-1
count = math.min(count, 0x7fffffff)
if virtuals[name] then
invframe[#invframe+1] = {count=count,index=#invframe+1,signal={name=name,type="virtual"}}
if items[name] then
invframe[#invframe+1] = {count=count,index=#invframe+1,signal={name=name,type="item"}}
elseif fluids[name] then
invframe[#invframe+1] = {count=count,index=#invframe+1,signal={name=name,type="fluid"}}
elseif items[name] then
invframe[#invframe+1] = {count=count,index=#invframe+1,signal={name=name,type="item"}}
elseif virtuals[name] then
invframe[#invframe+1] = {count=count,index=#invframe+1,signal={name=name,type="virtual"}}
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions src/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"name": "subspace_storage",
"variants": [
{
"version": "1.99.12",
"version": "1.99.15",
"factorio_version": "0.17",
"additional_files": { "compat.lua": ["compat", "factorio_0.17.lua"] }
},
{
"version": "1.99.13",
"version": "1.99.16",
"factorio_version": "1.0",
"additional_files": { "compat.lua": ["compat", "factorio_1.0.lua"] }
},
{
"version": "1.99.14",
"version": "1.99.17",
"factorio_version": "1.1",
"additional_files": { "compat.lua": ["compat", "factorio_1.1.lua"] }
}
Expand Down

0 comments on commit dd75530

Please sign in to comment.