forked from killzoms/Mobile-Factory
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata-final-fixes.lua
More file actions
79 lines (69 loc) · 2.67 KB
/
Copy pathdata-final-fixes.lua
File metadata and controls
79 lines (69 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
require("prototypes/animation/RCLProjectile.lua")
-- Highlight Resources --
for _, ore in pairs(data.raw.resource) do
ore.highlight = true
end
-- Make Dimensional Lab accept all materials --
if settings.startup["MF-lab-science-packs"].value == "all" then
local inputsTable = {}
for _, lab in pairs(data.raw.lab) do
if lab.inputs then
for _, name in pairs(lab.inputs) do
inputsTable[name] = name
end
end
end
local newInputs = {}
for _, name in pairs(inputsTable) do
table.insert(newInputs, name)
end
data.raw.lab.DimensionalLab.inputs = newInputs
elseif settings.startup["MF-lab-science-packs"].value == "add vanilla" then
local inputsTable = {}
local basicLab = data.raw.lab.lab
local dimLab = data.raw.lab.DimensionalLab
if basicLab and basicLab.inputs then
for _, name in pairs(dimLab.inputs) do
inputsTable[name] = name
end
for _, name in pairs(basicLab.inputs) do
inputsTable[name] = name
end
local newInputs = {}
for _, name in pairs(inputsTable) do
table.insert(newInputs, name)
end
dimLab.inputs = newInputs
else
log("Basic lab is missing, couldn't add science packs to Dimensional Lab.")
end
elseif settings.startup["MF-lab-science-packs"].value == "dimensional only" then
-- Do Nothing --
end
-- Increate the Stack Size of all Resources --
--for _, resource in pairs(data.raw.resource) do
-- if resource.minable ~= nil then
-- if resource.minable.result ~= nil then
-- if data.raw.item[resource.minable.result] ~= nil and data.raw.item[resource.minable.result].stack_size ~= nil and data.raw.item[resource.minable.result].stack_size < 1000 then
-- data.raw.item[resource.minable.result].stack_size = 1000
-- log("Increased stack size of " .. resource.minable.result)
-- end
-- elseif resource.minable.results ~= nil then
-- for _, result in pairs(resource.minable.results) do
-- if data.raw.item[result.name] ~= nil and data.raw.item[result.name].stack_size ~= nil and data.raw.item[result.name].stack_size < 1000 then
-- data.raw.item[result.name].stack_size = 1000
-- log("Increased stack size of " .. result.name)
-- end
-- end
-- end
-- end
--end
-- These mods make changes to collision masks that break Mobile Factory, so we need to fix them here.
if mods["space-exploration"] or mods["alien-biomes"] or mods["combat-mechanics-overhaul"] then
log("Fixing collision mask changes caused by Earendel mods")
data.raw.car.MobileFactory.collision_mask.layers.vehicle = true
end
-- Copy Mobile Factory collision mask to Deployment Entity --
local MobileFactory = data.raw.car.MobileFactory
local MFDeploy = data.raw["simple-entity-with-owner"].MFDeploy
MFDeploy.collision_mask = table.deepcopy(MobileFactory.collision_mask)