Skip to content

Commit edee049

Browse files
committed
Support chest ghosts
1 parent 1ceffdb commit edee049

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

mods_2.0/039_assembling-machine-request-chest-paste-multiplier/changelog.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
---------------------------------------------------------------------------------------------------
2+
Version: 2.0.2
3+
Date: 2024. 12. 31
4+
Info:
5+
- Support chest ghosts
6+
---------------------------------------------------------------------------------------------------
27
Version: 2.0.1
38
Date: 2024. 12. 30
49
Info:

mods_2.0/039_assembling-machine-request-chest-paste-multiplier/control.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,17 @@ for _, prototype in pairs(prototypes) do
1111
end
1212
end
1313

14+
local function get_entity_type(entity)
15+
return entity.type == "entity-ghost" and entity.ghost_type or entity.type
16+
end
17+
18+
19+
local function get_entity_name(entity)
20+
return entity.type == "entity-ghost" and entity.ghost_name or entity.name
21+
end
22+
1423
local function compatible(event)
15-
return (event.source.type == "entity-ghost" and event.source.ghost_type or event.source.type) == "assembling-machine" and requester_chest_names[event.destination.name]
24+
return get_entity_type(event.source) == "assembling-machine" and requester_chest_names[get_entity_name(event.destination)]
1625
end
1726

1827
local function serialize_requests(requester_chest)

mods_2.0/039_assembling-machine-request-chest-paste-multiplier/info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"title": "Assembling machine request chest paste multiplier",
44
"description": "Pasting an assembling machine several times on a requester chest increases the total requested.",
55

6-
"version": "2.0.1",
6+
"version": "2.0.2",
77
"author": "Quezler",
88
"factorio_version": "2.0",
99

0 commit comments

Comments
 (0)