Air Scrubbing


Adds air scrubbing to remove pollution and spores.

Content
4 days ago
2.0
14.8K
Enemies Manufacturing

b Incompatibility with Quality-SE mod

12 days ago

Hello I have been using Quality SE mod and encounter fatal crash with this mod.

The mod Air Scrubbing (0.2.5) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event atan-air-scrubbing::on_built_entity (ID 6)
Unknown entity name: epic-atan-air-scrubber
stack traceback:
[C]: in function 'create_entity'
atan-air-scrubbing/control.lua:17: in function <atan-air-scrubbing/control.lua:2>

Issue is this mod does not recognise Quality-SE fork and does not run copatibility code.
Some changes need to be done in --src\compatibility\quality\entity-updates.lua
Firstly adjusting mod detection to account for Qualite-SE

local qualityname = nil
if not mods["quality"] then
qualityname = "quality"
end
if not mods["quality-se"] then
qualityname = "quality-se"
end
if not qualityname then
return
end

Than any calls for data.raw["quality"] need to be replaced with data.raw[qualityname].

You could also consider adding Quality and Quality-SE as optional dependencies, while it is not necessary for the code, it will let users browsing this site know, what Quality forks are supported.

7 days ago

Thanks for the report. Fixed in 0.2.6.

5 days ago
(updated 5 days ago)

Turns out I was not entirely correct.
Array data.raw["quality"] should be used even for Quality-SE, not just quality.

Failed to load mods: ...-scrubbing__/compatibility/quality-se/entity-updates.lua:7: bad argument #1 of 2 to 'pairs' (table expected, got nil)
stack traceback:
[C]: in function 'pairs'
...-scrubbing__/compatibility/quality-se/entity-updates.lua:7: in main chunk
[C]: in function 'require'
...ir-scrubbing__/compatibility/quality-se/data-updates.lua:1: in main chunk
[C]: in function 'require'
atan-air-scrubbing/data-updates.lua:2: in main chunk

The code I sent you worked for me because I had a bug in it and forgot to remove NOT during copy paste in:
if NOT mods["quality"] then
qualityname = "quality"
end
Since I do not have quality mod running, it passed the condition and set the variable to "quality" and itterated the array correctly.

In the end no changes need to be made aside from detecting the Quality-SE mod and same array should be used. Only change needed is removing -se from the row 7 in the entity-updates.lua file.

I am sorry for sending code that was not tested even for simplest change in mod environment.

5 days ago

No problem. Fixed 0.2.7.

New response